Created
February 7, 2022 03:04
-
-
Save SweetAsNZ/a16ef1fe8ca0b5b3a3e52b94e5c075f5 to your computer and use it in GitHub Desktop.
Get All Windows Desktop OS's
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-DesktopOS{ | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory=$true)] | |
[string]$ComputerName | |
) | |
Get-ADComputer -Filter {Name -eq $ComputerName} -Properties Name,OperatingSystem,Enabled -ResultSetSize 1000000 | | |
Where-Object {($_.OperatingSystem -like "Windows*") -and ($_.OperatingSystem -notlike "Windows Server*")} | | |
Select-Object Name,Enabled,OperatingSystem | Sort-Object Name | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment