How can I specify a policy path on powershell? RRS feed

  • 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

    If you find the answer provided helpful, please click 'propose as answer' link
    Tuesday, August 8, 2017 4:39 PM
  • Hi,
    Just checking in to see if the information provided was helpful. Please let us know if you would like further assistance.

    Best Regards,


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, September 6, 2017 7:40 AM