5,455 questions with Windows Server PowerShell tags

Sort by: Updated
2 answers One of the answers was accepted by the question author.

remote start application by powershell

I access to remote computer via ssh and running powershell as AS to execute the following command but I can't see the Notepad++ running on remote computer. Invoke-Item -Path C:\Users\Dex\Desktop\Notepad++.lnk or Start-Process -FilePath …

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-08-27T07:52:04.287+00:00
Yendy Hui 21 Reputation points
commented 2020-09-15T13:44:53.843+00:00
SethWH 436 Reputation points
3 answers

Set-NTFSOwner doesn't work correctly with service account

I have Powershell script that creates home directory: New-Item -Path \\fileserver\homedir$\acn -ItemType Directory -Force -ErrorAction Stop | Out-Null When I test this with my own account that is Domain Admin, everything works fine. But when I try…

Windows 10 Security
Windows 10 Security
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
2,837 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-14T09:14:39.163+00:00
Timo Riikonen 1 Reputation point
answered 2020-09-15T02:54:09.9+00:00
Ian Xue (Shanghai Wicresoft Co., Ltd.) 34,191 Reputation points Microsoft Vendor
2 answers

Powershell to pass fixed Varibles (SCOM)

Hi all, Totally new to Powershell and would like some help. i have script to put all Agents behind a SCOM Gateway into Maintenance Mode: Import-Module OperationsManager $Time = ((Get-Date).AddMinutes(10)) $ErrorActionPreference = 'SilentlyContinue' …

Operations Manager
Operations Manager
A family of System Center products that provide infrastructure monitoring, help ensure the predictable performance and availability of vital applications, and offer comprehensive monitoring for datacenters and cloud, both private and public.
1,444 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-12T02:14:51.93+00:00
saiyad rahim 21 Reputation points
answered 2020-09-15T00:41:13.677+00:00
saiyad rahim 21 Reputation points
1 answer

how to check a value is that null in powershell script

I want to check the PasswordLastSet value of the user is that empty. PS Z:\> Get-ADUser -Identity test1 -Properties * | select passwordlastset passwordlastset --------------- By if to judgment is that null. this is my script $password =…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-11T05:00:52.607+00:00
Peizhi_Yu 1 Reputation point
commented 2020-09-11T14:54:05.57+00:00
Rich Matheisen 45,831 Reputation points
3 answers One of the answers was accepted by the question author.

SharePoint Online Get-SPOUser IsSiteAdm Error 429

Is there another way to find Site Administrators in SharePoint Online? I have tried the following but on some sites I get an error 429. Get-SPOUser -Site $SiteUrl -Limit All | select…

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,249 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-10T14:40:37.753+00:00
Terry N 146 Reputation points
accepted 2020-09-11T13:08:17.42+00:00
Terry N 146 Reputation points
2 answers One of the answers was accepted by the question author.

PS -nonewline not work on my console

Hello from PS very beginner. https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/write-host?view=powershell-7 when I try cmdlet "write-host -nonewline" on my PS console as tutorial(windows10 Home, PS 5.1) PS…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-10T08:00:07.783+00:00
Pio MOON 21 Reputation points
answered 2020-09-10T18:33:13.4+00:00
Rich Matheisen 45,831 Reputation points
3 answers One of the answers was accepted by the question author.

Remote Job - UNC or PSDrive not found

I have a scripts installed locally on a group of servers. Lets call them the worker scripts. I want to execute those scripts, remotely, as background jobs, from a management workstation. Lets call this the management script. I have the management…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-09T13:12:49.873+00:00
TreyS 166 Reputation points
answered 2020-09-10T14:52:36.747+00:00
TreyS 166 Reputation points
3 answers

how to block GET-ADUSER from showing result

Hello. I want to block GET-ADUSER from been able to show result. I was able to block users from opening AD users and computers but it look like the permissions doesn't apply to GET-ADUSERS How can I set that command to not show any results? Thank…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-08T17:01:22.29+00:00
Francois Roussel 1 Reputation point
commented 2020-09-10T11:23:31.56+00:00
Francois Roussel 1 Reputation point
1 answer

the return from Add-AppxPakcgae doesnt contain the UWP information the computer has

Hi, Team. Do you happen to know the potential root cause below ? phenomenon : the return from Add-AppxPakcgae doesn't contain UWP information the computer has. see below more explicit scenario I'm saying. When we did below command on Elevated Power Shell…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-09T22:58:58.12+00:00
Masa 1 Reputation point Microsoft Employee
answered 2020-09-10T08:19:19.933+00:00
Ian Xue (Shanghai Wicresoft Co., Ltd.) 34,191 Reputation points Microsoft Vendor
0 answers

Powershell Azure Function throws EXCEPTION: Connect-AzAccount : An attempt was made to access a socket in a way forbidden by its access permissions

Hi I have Powershell Azure function which is called directly by logic app as one of the steps in the workflow. Authentication was established by using system assigned managed identity approach and all was working. I needed to refactor the way how…

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,642 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-07-27T14:17:55.217+00:00
Roman Muntyanu 1 Reputation point
commented 2020-09-10T07:37:40.137+00:00
Igor Pavicevic 1 Reputation point Microsoft Employee
1 answer

Do until has strange settings

Hello, Sorry for the Dutch language; but could somebody help me with the following screenshot? It happens when I click on the settings of "do until": No idea how I can get back the screen of the limits etc... Thank you in…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-09T11:53:29.383+00:00
ChristopheDVDH 1 Reputation point
commented 2020-09-10T01:56:14.34+00:00
Ian Xue (Shanghai Wicresoft Co., Ltd.) 34,191 Reputation points Microsoft Vendor
3 answers

Powershell- Excel refresh credential window

Hello. I've seen a few questions about this placed since 2016, but no answers. I'm updating an excel spreadsheet with the .refresh command through a powershell script. This pulls up the modal window in Excel prompting for credentials. The credentials…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-08-29T14:32:24.72+00:00
Trevor 1 Reputation point
answered 2020-09-09T14:59:10.583+00:00
Trevor 1 Reputation point
3 answers

Get DirectoryName for folder

I have this script which exports a list of files and folders to a csv. Get-ChildItem -path D:\VmWare -Recurse | Select-Object DirectoryName, Name, Extension, Length | Export-Csv -Path D:\Temp\Test.csv -Encoding Unicode -NoTypeInformation I…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-08T12:04:16.967+00:00
Marcus Östman 21 Reputation points
answered 2020-09-09T11:35:06.287+00:00
Keith Miller 6 Reputation points
4 answers One of the answers was accepted by the question author.

List User OU in csv

Good afternoon, I have to export the list of users contained in an OU to a csv file, the code I wrote is the following: Get-ADUser -Filter * -SearchBase "OU = XX, OU = YY, DC = mydomain, DC = local" -Properties DisplayName | Select-Object…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-07T13:27:02.237+00:00
roberto vizzini 61 Reputation points
answered 2020-09-09T09:50:47.943+00:00
roberto vizzini 61 Reputation points
1 answer

Power sheel Script need to exicute Sql Server data project in Pre Post Build section.

Hi Team, i am trying to connect postgres ODBC driver into SQL server data project to compare the Schema. Power Shell script is: ion Get-ODBC-Data{ param([string]$query=$(throw 'query is required.')) $conn = New-Object…

Azure Database for PostgreSQL
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,677 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-03T05:25:43.687+00:00
Uma Mahesh U 1 Reputation point
commented 2020-09-08T07:37:46.407+00:00
Ian Xue (Shanghai Wicresoft Co., Ltd.) 34,191 Reputation points Microsoft Vendor
2 answers One of the answers was accepted by the question author.

Catch exitcode from EXE

Hi, I'm trying to catch errorlevel/exitcode from a executable, both return 0. I don't understand why. The folder "d:\Temp\exists\" exists. $rar="c:\Program Files\WinRAR\Rar.exe" $archive1="TMP.rar" $argList =…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-05T09:43:39.89+00:00
Marcus Östman 21 Reputation points
commented 2020-09-07T22:00:38.157+00:00
Rich Matheisen 45,831 Reputation points
1 answer

Why I cannot find where a property is defined in PowerShell? Where is the source code of the PSObject class?

I want to find the PSObject.cs file in Github, but I cannot find it. And I haven't find any file containing definition of this class (System.Management.Automation.PSObject). In source code of many other classes of PowerShell, I found that the PSObject…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-07T10:02:01.697+00:00
dx 1 Reputation point
commented 2020-09-07T21:39:07.997+00:00
Rich Matheisen 45,831 Reputation points
3 answers

get the security settings from GPO using xml report

I want to export the security settings of a group policy. I have exported the gpo to xml format and then I am using the below: $x.GPO.Computer.ExtenstionData.Extension Where $x contains the xml report. However I getting the result like below: q1 …

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-03T05:28:42.63+00:00
Sam White 26 Reputation points
answered 2020-09-06T02:49:05.817+00:00
Sam White 26 Reputation points
1 answer

How to use powershell to manage startup items of uwp app in windwos 10?

I hope to enable/disable the uwp app's startup items through powershell, but I tried to use gcim win32_startupcommand and Get-Item HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run and they couldn’t be found, shell:startup is…

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-04T18:27:04.637+00:00
Victor Chen 106 Reputation points
answered 2020-09-05T12:52:44.697+00:00
js2010 191 Reputation points
3 answers

I need to change commas to dot in an excel file using Powershell

I need someone to help me solve this problem. I need to write a powershell script which changes the commas of the excel file to dots. The commas are between the numbers. The table is built up like this: user name user surname …

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,455 questions
asked 2020-09-03T11:45:32.857+00:00
Fusionized 21 Reputation points
answered 2020-09-04T15:03:20.757+00:00
Rich Matheisen 45,831 Reputation points