I have recently deployed LAPS (Local admin password service) on our domain, and would now like to create a script I can run to find machines that have not yet communicated with AD to install the group policy extension and update their local admin password.
I can see that if I run:
Get-AdComputer -Identity Computer_Name -Properties *
I am presented with a computer that has updated its password, and shows the two properties:
ms-Mcs-AdmPwd
ms-Mcs-AdmPwdExpirationTime
My powershell is not great, so I may have the syntax wrong, but when trying to run:
Get-AdComputer -Filter {ms-Mcs-AdmPwd -ne ''}
I get an error that says:
The search filter cannot be recognised
Can anyone advise how I can filter on these two properties? Do I have to pipe into a Where-Object or perhaps even use LDAP filters?