Script to fix issues described in KB947222


This Windows PowerShell script will modify the file permission.


When user redirect the Documents folders to network share, the folders name changes back to My Documents as shown in the following figure. This issue can be fixed by denying Read permission to the administrator for the Desktop.ini files on the server. But the customers need to perform steps one by one. It would be great if we have a script to automate this task.


Step 1: Click Start, type powershell in the search box on the Start Menu, right-click the Windows PowerShell icon, and then click Run Windows PowerShell as administrator. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue. 


Step 2:  Run the script in Windows PowerShell Console (type the name of the script at the command prompt) 


The result as shown in the following figure:

Part of the Script as below

        if ($DesktopPath -ne $null) 
                $DesktopAcl = (Get-Item $DesktopPath.FullName -Force).GetAccessControl("Access") 
                 $AclSet = New-Object System.Security.Accesscontrol.Filesystemaccessrule("administrators","Read","Deny") 
                 Set-Acl $DesktopPath.FullName $DesktopAcl  
                $Status = "Success" 
                #define a custom object 
                $ObjInfo = New-Object -TypeName PSObject 
                Add-Member -InputObject $ObjInfo -MemberType NoteProperty -Name "Path" -Value $DesktopPath.FullName 
                Add-Member -InputObject $ObjInfo -MemberType NoteProperty -Name "Permission" -Value "Read" 
                Add-Member -InputObject $ObjInfo -MemberType NoteProperty -Name "Allow/Deny" -Value Deny 
                Add-Member -InputObject $ObjInfo -MemberType NoteProperty -Name "Status" -Value $Status 
                $Objs +$ObjInfo 


Windows PowerShell 2.0

Additional Resources

Editing permissions on a file or folder

Related forum threads: