dlwyatt / PolicyFileEditor

PowerShell functions and DSC resource wrappers around the TJX.PolFileEditor.PolFile .NET class.
Apache License 2.0
189 stars 33 forks source link

Running with intune #19

Open mortenbohmer opened 4 years ago

mortenbohmer commented 4 years ago

Hi

Trying to adjust some local gp settings, script works just fine when executed directly on a machine, but not with intune. The script is executed successfully, but nothing happends to the local GP. The scripts includes installing of nuget and the PolicyFileEditor module, this has been tested and works.

Also there seems to be an issue with a computer that is AzureAD joined, here the computer will have an empty GroupPolicy folder, until someone manually initializes the directory. Is there any way to initialize or will the powershell module do this ?

Script: $UserPolicy = 'C:\windows\system32\GroupPolicy\User\Registry.pol' $Ctx_Files_Key = 'Software\Policies\Citrix\Citrix Files'

Set-PolicyFileEntry -Path $UserPolicy -Key $Ctx_Files_Key -ValueName 'Account' -Type String -Data 'server-name-1'

Set-PolicyFileEntry -Path $UserPolicy -Key $Ctx_Files_Key -ValueName 'MountPoint3-DisplayName' -Type String -Data 'Citrix Files Area 3'
Set-PolicyFileEntry -Path $UserPolicy -Key $Ctx_Files_Key -ValueName 'MountPoint3-ShareFile' -Type String -Data 'Shared Folders\\Folder3'
Set-PolicyFileEntry -Path $UserPolicy -Key $Ctx_Files_Key -ValueName 'MountPoint3-Local' -Type String -Data 'k:'

Set-PolicyFileEntry -Path $UserPolicy -Key $Ctx_Files_Key -ValueName 'MountPoint4-DisplayName' -Type String -Data 'Citrix Files Area 4'
Set-PolicyFileEntry -Path $UserPolicy -Key $Ctx_Files_Key -ValueName 'MountPoint4-ShareFile' -Type String -Data 'Shared Folders\\Folder4'
Set-PolicyFileEntry -Path $UserPolicy -Key $Ctx_Files_Key -ValueName 'MountPoint4-Local' -Type String -Data 'l:'