Questions tagged [powershell]

An interactive shell, scripting and programming language, and surrounding environment from Microsoft. Commonly used by system administrators managing Microsoft software (including Windows, Exchange, SharePoint, and cloud services Azure and Office 365), PowerShell is included by default with Windows, and takes over from previous languages such as VB Script.

Filter by
Sorted by
Tagged with
1 vote
0 answers
24 views

Remote shutdown with a shutdown reason code

I'd like to power off a remote machine by Stop-Computer command in PowerShell. Is there any way to send a shutdown reason code (like Hardware: Maintenance (Planned)) as if choosing during local ...
0 votes
1 answer
19 views

How to handle characters that need UTF-8 on XML retrieved from HTTP GET on powershell?

I am not able to retrieve data under UTF-8 encoding, through a HTTP GET request on powershell. Code: $headers_tables=@{} $headers_tables.Add("content-type", "application/xml; charset=...
0 votes
1 answer
22 views

How to save/print a powershell terminal text in the end of a script run through powershell commands?

I've a script that needs user inputs, and also let them check all the data being displayed, while script is running, and in the end, save/print all the content, to a file, through powershell commands. ...
0 votes
0 answers
17 views

PRTG PowerShell Remoting Requirements for Custom EXE/Script Advanced Sensor

I've created a script for checking the TLS certificate assigned to an SMTP Relay server which supports SMTPS. The code is available here if that's of interest. The documentation says that powershell ...
  • 1,140
0 votes
1 answer
30 views

can't automate the authentication process with PowerShell on Linux

On Debian 11, I have installed PowerShell 7.3.0. I am testing if I can run commands on a remote Windows computer. This is a simple example to get the remote computer hostname. #!/usr/bin/env pwsh $...
-1 votes
0 answers
21 views

Hyper-V Manager - Remote Connection issue

OS: Windows Server 2012 R2 -OS level firewall is disabled I have done so much troubleshooting I don't know where to start. Here's the root of the problem: Step 1) Open up Hyper-V manager on <...
  • 1
1 vote
0 answers
18 views

OneDrive, can you migrate shared locations from one computer to another?

We are migrating users to new computer, and they have around 10 different SharePoint sites. Is there a way to copy the settings to a new computer, without manually doing so. I've looked at Computer\...
-2 votes
0 answers
27 views

Install MSI on remote computer with admin rights

Here's my problem: I need to install an MSI on computers in my domain and it requires admin privileges to be execute. I tried to use the classic MSI deploy procedure via GPO and even using some batch ...
  • 1
0 votes
1 answer
23 views

Accessing more properties of Local Security Policy with powershell

I want to modify any property that is in secpol.msc > Security settings > Account Policies. Microsoft unfortunately only gives support for a few of them, so there are still properties that I can'...
0 votes
0 answers
26 views

Understanding how windows server storage spaces physical disk redundancy works dependent on where its configured

Im tasked with configured a windows server to used tiered storage using the following disks 4x 900 GB SSDs 10x 2.2TB HDDs The SSD tier would be configured using parity with 1 redundant disk and the ...
-1 votes
0 answers
15 views

Applying Policies in Powershell

I am trying to set a policy that will lock a computer after the user has been idle for 10 minutes then require a password to get back in. I have been searching for quite some time, but can only find ...
  • 1
-1 votes
1 answer
52 views

Stop and Start IIS Website remotely using WMSVC

We have configured access to a web site on a remote machine using the guide here. This lets us access the remote web site using WMSVC. The end goal though is we want to be able to connect to the site ...
0 votes
0 answers
26 views

Powershell: get-volume -> export-excel, "Driverletter" displayed as '0' instead of Letters

I am having a difficult time understanding why the exported excel is showing 0 under "DriveLetter" instead of actual drive letters like C, D etc... The script is simple: Get-Volume | Select-...
0 votes
0 answers
58 views

Adding a group to a folder structure "basing" on another existing group's rights

thanks for reading this wall of text anyways. My scenario: i have a mega-folder called Projects. Every subfolder is a different project. So, for example, i have Projects\N123456 - New Coca Cola. Now, ...
0 votes
0 answers
17 views

PowerBI running in efficiency mode but cannot disable and is affecting users performance

User updated to the newest version of Win11 earlier today, and they are a heavy PowerBI user. Since this update they have noticed that the application is running in efficiency mode and is impacting ...
  • 13
-1 votes
0 answers
15 views

Given a process id is it possible from powershell to "drop a file" on the main window of the process?

I've found a process id via $p = get-process | Where-Object -Property Name -eq "MyApp" and I know that MyApp accepts files dropped on it's main window from the desktop. Is it possible ...
0 votes
1 answer
35 views

I want to use openssl pkcs12 to convert lots of pem files into pfx files - but is it possible to pass in a password via the command line?

I want to use openssl pkcs12 to convert lots of pem files into pfx files - but is it possible to pass in a password via the command line? I have quite a lot of pem files: So I want to enter a ...
  • 175
0 votes
1 answer
44 views

I cannot get an otherwise functional Powershell script to run on a schedule

Environment: Server 2019 Domain Controller. I have a simple script that combs through my AD users and disables anyone who hasn't logged in within the past 35 days (org policy). Looks like this: Get-...
0 votes
0 answers
26 views

Why cannot I map an DSF/SMB share using New-SmbGlobalMapping?

I've got a DFS folder: \\my.domain\Storage$ I'd like to map it to a particular Windows Server Core machine using the New-SmbGlobalMapping PowerShell command using specific credentials. Alas, when I ...
  • 367
0 votes
0 answers
14 views

Assign an AD Group Read only Permission to Multiple User Home Drive Folders using CSV list

I'm trying to put together a script to perform the following task: First to add an AD Security Group named "ADMigration" and assign it (Read access) to a large list of User Home Drives (...
  • 1
0 votes
0 answers
181 views

Connecting to remote server failed: The WinRM client cannot process the request

I am trying to execute a powershell script on a remote server from my local machine, however I get an error. Here is the full error message: Connecting to remote server failed with the following ...
1 vote
0 answers
23 views

Windows test network folder permissions for another account

How to test that an account other than login account has access to a network folder ? Here's an example : I'm logged in as steves but I need to test if joej has access to : \\contoso\dept\finance\...
  • 201
1 vote
0 answers
41 views

Compliance search initialization for "task search1" failed with exception: Object reference not set to an instance of an object

I've a script to start a Search task on Content Search, of Compliance. If I use my own user account to login, I am able to run it, but if I use an unattended login through an App, like the one of App-...
0 votes
1 answer
65 views

how export get-vm info to csv file in PowerShell?

How can I export this output to csv file ? I have this output from below get-vm command: Get-VM | Select Name, PowerState, GuestId, @{N="VM Config File";E={$_.extensiondata.config.files....
  • 155
0 votes
0 answers
53 views

How to enumerate privileges of a given AD Domain user?

I am currently working on a non-privileged Powershell of a domain joined host, trying to enumerate all privileges of one AD user. After doing some research, I understood there is no straight-forward ...
2 votes
2 answers
239 views

Connect-IPPSSession with CertificateThumbPrint cmdlet showing sign in popup

I've set an application to be used by a script, to login on exchange online on an unattended way, following this tutorial. But when I try to login with it, I got the following outcome, there is a ...
0 votes
1 answer
91 views

WinRM connectivity issues with workgroup and vlan subnet

Situation: 1 server (Windows Server 2022) (192.168.15.5) 1 client (Windows 11) (192.168.5.5) Unifi network setup where both machines are on a different VLAN (subnet) On the server: Run Winrm ...
0 votes
0 answers
88 views

Only 2 cipher suites are offered by Powershell Invoke-WebRequest

I am performing a Invoke-WebRequest to a site using Powershell. And i'm facing error "Could not create SSL/TLS secure channel" PS C:\Users\admin> Invoke-WebRequest -URI https://...
  • 101
0 votes
0 answers
32 views

AD User and Group Report

I just inherited a process in place that combined 2 PowerShell scripts: Get list of AD User properties. Get list of User group memberships I have added the group membership property to User script, ...
2 votes
1 answer
96 views

Microsoft Powershell Signature Script - Stopped working with latest office 365 build

This is my first post on here, so I hope I get all the information across to you! Firstly, I know that there are paid solutions that can do this, but this solution has been working for the company ...
0 votes
0 answers
62 views

How to connect to a computer with custom WinRM port using Windows Admin Center?

My remote computer has a custom HTTPS WinRM port, I can connect to it using Enter-PSSession just fine and everything works as expected, but don't know how to do it in Windows Admin Center, couldn't ...
-1 votes
1 answer
28 views

Automate shutdown of windows server when all apps are closed

I have three high processing machines running on AWS. Our engineers run specific applications on it that requires like 192 GB of RAM. Main idea behind this is after they start processing the job, no ...
  • 1
0 votes
1 answer
28 views

Best practice for application installation with powershell scripts from shared domain

Please could someone outline best practice when running a powershell batch script for application installations when deploying. Should individual application installation files be available temporary ...
1 vote
1 answer
119 views

How to run Powershell from batch file with normal background colors?

When I click the Powershell icon, it comes up with a blue background and a certain look. If I run Powershell from a batch file, it comes up with a black background that looks like cmd.exe. Is there a ...
  • 396
0 votes
0 answers
24 views

Calling InstallStatusMIF from Powershell during MECM/SCCM package deployment

I am creating a package that will be deployed via MECM (SCCM). The Program inside the package is a Powershell script. When the program fails, I want an error message or execption to be displayed in ...
  • 101
0 votes
1 answer
87 views

Powershell Script to check free disk space on servers

I am in need to check free space on servers but I am getting more than enough details. DeviceID : C: DriveType : 3 ProviderName : FreeSpace : 76691152896 Size : 160482455552 ...
  • 11
1 vote
1 answer
322 views

How to get a complete list of all installed software via Powershell?

I'm trying to figure how to view the version numbers of all installed software in Powershell on Windows 10. I dug up an example but when I compare the generated list to what's in Control Panel > ...
  • 179
0 votes
0 answers
27 views

Can't Export a guest VM using a Volume ID as path in Powershell while it works with the GUI

For some reasons I won't debate here, I would like to be able to export VMs (on a Win 2019 hyper-v host) to "hidden" volumes (with no drive letter attached). While this works from the hyper-...
  • 1
0 votes
0 answers
62 views

How to change "specify intranet microsoft update service location" group policy with powershell

I am trying to change a group policy via a PowerShell script. I understand that group policies are basically just registry keys, and you can change the underlying registry values to edit the policies. ...
0 votes
1 answer
184 views

Calling WMI on a remote machine with PacketIntegrity authentication level (with KB5004442 activated)

I'm trying to retrieve a WMI objects on a remote machine using the following powershell code : Get-WmiObject -ComputerName mymachine -class Win32_operatingSystem -Authentication PacketIntegrity ...
  • 51
0 votes
0 answers
19 views

Powershell Script to Uninstall Application from Multiple Users Computers

I have 200+ users within the company I work for who have Malwarebytes installed on their laptops but we need to uninstall it from all their devices. I was thinking the most efficient way to go about ...
1 vote
1 answer
163 views

How to run cmd.exe using the system account on Windows 11?

I want to run cmd.exe not as administrator, but as the local system account on Windows 11. Apparently it was possible on Windows 10 using psexec. On Windows 11 with psexec v2.40 I get this error from ...
  • 111
0 votes
1 answer
131 views

winget not working unless I do

When I open Powershell, and type winget - this is the response: winget : The term 'winget' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of ...
0 votes
1 answer
120 views

Send-MailMessage thorugh Office 365 operation times out

I need to send an email report from a script. If I do this from one of our mail relays the email appears as [EXTERNAL]. Since this report includes links, I want users to trust it as coming internally. ...
0 votes
1 answer
29 views

Restart multiple Azure VMSS with time shedule with Powershell Script

I have multiple windows and Linux VMSS machines in azure, I need to recreate the pods, particularly with the windows machine after x days of creation. I need to implement it with help of Powershell ...
  • 1
0 votes
0 answers
89 views

Is it possible to generate a new self-signed certificate from an existing private key with powershell?

New-SelfSignedCertificate -ExistingKey "c:\cts_privkey.pem" -Container localhost -Provider "Microsoft Enhanced RSA and AES cryptographic Provider" -DnsName "example.com" -...
  • 101
0 votes
0 answers
87 views

Powershell Remote Connection to Active Directory

I am trying to connect to a remote server via Active Directory Cmdlets like "Get-ADGroup -Server xx.xx.xx.xx" (Microsoft.ActiveDirectory.Management.dll). The connection can't be established ...
  • 131
1 vote
2 answers
96 views

How to make PowerShell read from a pipe?

I need to make PowerShell on Windows Server 2019 to read from a (not named) pipe and launch the commands it reads, so I'll be able to launch multiple commands on the same shell, even without knowing ...
3 votes
2 answers
74 views

Powershell Where-Object Not Filtering Expanded Property

I am trying to get a list of all email addresses that we have registered in our on-prem Exchange but I want to exclude all of the X400 type addresses. I have tried all of the following commands: Get-...
  • 432
0 votes
2 answers
48 views

Is there a way to see Azure AD Connect version using Powershell without access to the local servers?

Is there a way to see the Azure AD Connect version using Powershell without access to the local servers that is running the Azure AD Connect client? Think of it as a simple environment with servers On-...
  • 299

1
2 3 4 5
81