param(
[Parameter(Mandatory=$true,Position=1)][string]$Query
)
$filter = "anr=$Query"
$dc = "YourDC:3268"
Get-ADObject -LDAPFilter $filter -Server $dc
Usage
.\Get-Something01.ps1 osxx
Output
DistinguishedName | Name | ObjectClass | ObjectGUID |
CN=Osman SHENER,… | Osman SHENER | user | 2c973a30-4e… |
CN=osxxNOT01,OU=… | osxxNOT01 | computer | 840e9c35-4d… |
CN=osxxOSDW7TEST… | osxxOSDW7TEST20 | computer | afe1c1fe-41… |
CN=osxxPC01,OU=W… | osxxDSK01 | computer | 3db219e1-44… |
CN=osxxVM,OU=San… | osxxVM | computer | ecefbb2f-44… |
No comments:
Post a Comment