Public/Get-ServersAndWorkstations.ps1
<#
.SYNOPSIS Short description .DESCRIPTION Long description .EXAMPLE PS C:\> <example usage> Explanation of what the example does .INPUTS Inputs (if any) .OUTPUTS Output (if any) .NOTES General notes #> function Get-Servers { [CmdletBinding()] param ( [Parameter(Mandatory = $FALSE)] [String]$Name = "*" ) Get-ADComputer -Filter { (OperatingSystem -like "*windows*server*") -and (Enabled -eq "True") } -Properties OperatingSystem | Where-Object { $_.Name -like $Name } | Sort-Object Name } function Get-Workstations { [CmdletBinding()] param ( [Parameter(Mandatory = $FALSE)] [String]$Name = "*" ) Get-ADComputer -Filter { (OperatingSystem -notlike "*windows*server*") -and (Enabled -eq "True") } -Properties OperatingSystem | Where-Object { $_.Name -like $Name } | Sort-Object Name } |