$gp_name = "Map Study Drive" New-GPO -Name $gp_name $gp = Get-GPO -Name $gp_name $gp_id = $gp.Id $create_date = Get-Date -Format "yyyy-MM-dd HH:mm:ss" $xml_path = "{{ policy_path }}\{$gp_id}\User\Preferences\Drives" New-Item -ItemType Directory -Force $xml_path $data = @" "@ $data | Out-File $xml_path\Drives.xml -Encoding utf8 -Force $DomainInfo = Get-ADDomain $DomainOU = $DomainInfo.DistinguishedName $workbenchOU = (Get-ADOrganizationalUnit -Identity "OU=Workbench,$DomainOU").DistinguishedName New-GPLink -Name $gp_name -Target $workbenchOU Write-Output "THIS SCRIPT ACTUALLY RAN" | Out-File -FilePath 'C:\eidf\StudyDriveScript.txt'