Hi,
Im a noobie with Powershell, please go easy on me. The help desk or systems team forgets to move the newly created workstation or servers from the COMPUTERS OU into their respective OUs.
The goal is to create a powershell script that pulls a list of computer objects, along with their Operating System. Also, For computer objects running a server operating system (i.e. Windows Server 2008/2012, etc), email that list to the systems team and non server machines to the helpdesk email.
I only found a way to output these results via csv, but not html or export the html to email. Any help master powershell writers? e-books, links. Thanks for reading.
Get-ADComputer -Filter {(OperatingSystem -notlike “Windows XP Professional”) -and (OperatingSystem -notlike “Windows 7”) -and (OperatingSystem -notlike “Windows 10 Pro”) -and (OperatingSystem -notlike “Windows 10 Enterprise”) -and (OperatingSystem -notlike “MAC”)} -SearchBase “CN=null,DC=null,DC=null” -Properties Name,OperatingSystem,Description | Select Name,OperatingSystem,Description |Sort-Object -Property OperatingSystem -Descending | Export-Csv C:\Servers_OU_Info.csv -NoTypeInformation -Encoding UTF8