sqlagent007
asked on
powershell - is there an easy way to query AD for a SPN -like '*my-sql-instance*'?
I am trying to add a check for the SPN in our SQL review script. I will have the ability to build a variable with the SQL server name instance name.
When I use CMD > setspn -L DOMAIN\USER I get a list that I can search and see if the SPN has been created or not.
There must be a way I can use powershell to get that list, then search the list for a string value.
Just to be specific, I am looking for a way to use powershell to query Active Directory for a value LIKE 'my-sql-intance' name. I just need to return SPNs that look like they match the string value.
When I use CMD > setspn -L DOMAIN\USER I get a list that I can search and see if the SPN has been created or not.
There must be a way I can use powershell to get that list, then search the list for a string value.
Just to be specific, I am looking for a way to use powershell to query Active Directory for a value LIKE 'my-sql-intance' name. I just need to return SPNs that look like they match the string value.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
ASKER
Open in new window
I had to install and import the "get-ad" modules, but then it worked like a champ.