# How can I specify a policy path on powershell?

• ### Question

• Hi, I currently am working on a script that I want to allocate inside a group policy in my domain.

But everytime when I specify the path "(mydomain.com)\Sysvol\(mydomain.com)\Policies\1DB9E5..\User\Documents & Settings\file.txt'' powershell does not accept the numbers on the policy ID (which starts with 1DB9...)

Also, should I modify "Documents & Settings" to "Documents_&_Settings"?

Tuesday, August 8, 2017 11:48 AM

### All replies

• If I'm not wrong a path should look like this:
'\\<Server>\sysvol\<Domain>\Policies\{Policy-ID incl curly braces}\User\...'

Grüße - Best regards

PS:> (79,108,97,102|%{[char]\$_})-join''

Tuesday, August 8, 2017 12:02 PM
• Why are you trying to access GPOs directly? What command are your using?   A GPO is a read-only folder that is managed by AD.  The policies are stored as GUIDs. It is not intended that you should access them directly.

With the GPO CmdLets a "Path" is an AD path and not a folder path.

Scripts with GPO are attached to a GPO and stored with the GPO.  You cannot copy  script into a GPO and have it work.

Post GPO questions in the GPO forum for more complete information.

\_(ツ)_/

Tuesday, August 8, 2017 12:05 PM
• What are you trying to do ?

Are you trying to configure a logon powershell script to which you pass the ....txt file path and it fails ?

I guess yes, since you have "User" on the path ...

Here is a sample path to specify on the 'script parameters'  field of the settings of the logon script section
in the GPO. The path should be included between double or simple character.

"\\abc1.local\SYSVOL\ABC1.local\Policies\{6AC1786C-016F-11D2-945F-00C04fB984F9}\USER\documents & settings\text1.txt"

Managing Office 365, Identities and Requirements
Windows Server Virtualization, Configuration