![]() ![]() Specifies a query string that retrieves Active Directory objects. This command shows the name, DNS hostname, and IPv4 address. Get-ADComputer -Filter 'Name -like "Computer01*" -and PasswordLastSet -ge $Date' -Properties IPv4Address | Example 6: Get all computers with a name starting with Computer01 or Computer02 Get-ADComputer -Filter 'Name -like "Computer01*" -or Name -like "Computer02*"' -Properties IPv4Address |Ĭomputer01-SRV1 10.194.99.181Ĭomputer02-SRV2 10.194.100.3 Example 7: Get all computers with a name starting with a string AND password last set before 30 days $Date = ::Today.AddDays(-30) ![]() Example 5: Get all computer accounts using a filter Get-ADComputer -Filter * This command gets the computer accounts in the locationĬN=Computers,DC=User01,DC=com that are listed as laptops by using an Example 4: Get computer accounts in a specific location using an LDAPFilter Get-ADComputer -LDAPFilter "(name=*laptop*)" -SearchBase "CN=Computers,DC= User01,DC=com" This command gets all the computers that have changed their password in the last 90 days. Get-ADComputer -Filter 'PasswordLastSet -ge $Date' -Properties PasswordLastSet | Example 3: Gets all computers that have changed their password in specific time frame $Date = ::Today.AddDays(-90) String and shows the name, DNS hostname, and IPv4 address. This command gets all the computers with a name starting with a particular Example 2: Get all computers with a name starting with a particular string Get-ADComputer -Filter 'Name -like "User01*"' -Properties IPv4Address |įormat-Table Name, DNSHostName, IPv4Address -AutoSize This command gets a specific computer showing all the properties. Examples Example 1: Get specific computer that shows all properties Get-ADComputer -Identity "User01-SRV1" -Properties *ĪllowReversiblePasswordEncryption : FalseĬanonicalName : /Computers/User01-srv1ĭistinguishedName : CN= User01-srv1,CN=Computers,DC=fabrikam,DC=comĭSCorePropagationData : Properties for computer objects, see the Properties parameter description. For more information about the how to determine the This cmdlet retrieves a default set of computer object properties. If you haveĮxisting Lightweight Directory Access Protocol (LDAP) query strings, you can use the LDAPFilter Syntax, type Get-Help about_ActiveDirectory_Filter. For more information about the Filter parameter PowerShell Expression Language syntax provides rich type conversion support for value The Filter parameter uses the PowerShell Expression Language to write query strings for Activeĭirectory. To search for and retrieve more than one computer, use the Filter or LDAPFilter parameters. Pass a computer object through the pipeline to the Identity parameter. Parameter to a computer object variable, such as $ or (SID) or Security Accounts Manager (SAM) account name. You can identify a computer by its distinguished name, GUID, security identifier The Identity parameter specifies the Active Directory computer to retrieve. The Get-ADComputer cmdlet gets a computer or performs a search to retrieve multiple computers. Gets one or more Active Directory computers. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |