Link to home
Start Free TrialLog in
Avatar of gmckfn
gmckfnFlag for United States of America

asked on

How to link GPO to domain via Powershell script when you dont know domain name

I have a GPO called taco that I created with powershell script.   I need to link this to the domain but I don't know what the name of the domain is.   This is a generic powershell script that my customers will use to link the taco GPO to their individual domains.  I need to call the domain, find the FQDN and then insert it into this script:

-name Taco | new-gplink -target "ou=????,dc=?????,dc=?????" | set-gppermissions -permissionlevel gpoedit -targetname "Domain Admins " -targettype group

I need to figure out how to get those ???? populated in the script.  windows server 2008 R2

hope that makes sense :)
ASKER CERTIFIED SOLUTION
Avatar of Raheman M. Abdul
Raheman M. Abdul
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gmckfn

ASKER

Perfecto!!!!