Deploy printer via GPO. 0x80070005 Access is denied

When trying to add a printer via GPO I got a warning in the application log on the remote desktop server.

The user ‘Printer1’ preference item in the ‘Printers {GUID}’ Group Policy object did not apply because it failed with error code ‘0x80070005 Access is denied.’ This error was suppressed.

Solution:
Activate “Run in logged-on user’s security context (user policy option)” under common tab on the printer properties in the GPO.

Accessing the resource ‘\\servername’ has been disallowed

On a remote desktop server I got the message: Accessing the resource ‘\\servername’ has been disallowed when trying to access \\servername from file explorer.

The GPO setting that caused this was:
User Configuration/Administrative Templates/Start Menu and Taskbar/Remove Run menu from Start Menu.

When i disabled this setting the users could access servers from file explorer.

Enable and start SQL Server Agent (Agent XPs disabled)

After installing Microsoft SQL Server 2012 I tried to start SQL Server Agent (Agent XPs disabled) in SQL Server Management Studio. Didn’t work and I got a message to enable the agent with sp_configure.

1. Create a new query in SQL Server Management Studio.

2. Execute the following:
sp_configure ‘show advanced options’, 1;
GO
RECONFIGURE;
GO sp_configure ‘Agent XPs’, 1;
GO
RECONFIGURE
GO

3. Start the SQL Server Agent by right clicking on SQL Server Agent (Agent XPs disabled) in SQL Server Management Studio and choose start.

GPO to Hide Control Panel Items

Path in Group Policy Management Console: User Configuration/Policies/Administrative Templates/Control Panel/Hide specified Control Panel items.

Values:
Microsoft.AdministrativeTools
Microsoft.ActionCenter
Microsoft.AutoPlay
Microsoft.DefaultPrograms
Microsoft.DeviceManager
Microsoft.iSCSIInitiator
Microsoft.NetworkAndSharingCenter
Microsoft.PhoneAndModem
Microsoft.PowerOptions
Microsoft.ProgramsAndFeatures
Microsoft.RemoteAppAndDesktopConnections
Microsoft.System
Microsoft.TextToSpeech
Microsoft.Troubleshooting
Microsoft.UserAccounts
Microsoft.WindowsFirewall
Microsoft.WindowsUpdate
Flash Player
Java
Install Application On Remote Desktop Server

More values can be found here.

Restore a deleted Active Directory object with PowerShell

This requires that you have enabled the enable Active Directory Recycle Bin before you deleted the object.

Run Windows PowerShell as Administrator.

Start by loading the Active Directory module for Windows PowerShell:
Import-Module ActiveDirectory

List all deleted users (for some reason computer objects also are included when you use objectclass -eq “user):
get-adobject -filter ‘objectclass -eq “user” -AND IsDeleted -eq $True’ -IncludeDeletedObjects -properties IsDeleted,LastKnownParent | Format-List Name,IsDeleted,LastKnownParent,DistinguishedName

List all deleted groups:
get-adobject -filter ‘objectclass -eq “group” -AND IsDeleted -eq $True’ -IncludeDeletedObjects -properties IsDeleted,LastKnownParent | Format-List Name,IsDeleted,LastKnownParent,DistinguishedName

List all deleted computers:
get-adobject -filter ‘objectclass -eq “group” -AND IsDeleted -eq $True’ -IncludeDeletedObjects -properties IsDeleted,LastKnownParent | Format-List Name,IsDeleted,LastKnownParent,DistinguishedName

List all deleted objects:
get-adobject -filter ‘IsDeleted -eq $True’ -IncludeDeletedObjects -properties IsDeleted,LastKnownParent | Format-List Name,IsDeleted,LastKnownParent,DistinguishedName

If you want the output in a text file:
1. Create a script file named list_deleted_users.ps1 and save it to C:\Script\.
2. Use the follwong code in the script:
Import-Module ActiveDirectory
get-adobject -filter ‘objectclass -eq “user” -AND IsDeleted -eq $True’ -IncludeDeletedObjects -properties IsDeleted,LastKnownParent | Format-List Name,IsDeleted,LastKnownParent,DistinguishedName
3. Save the script file.
4. In PowerShell navigate to C:\Script and run the following command:
.\list_deleted_users.ps1 > output.txt
5. You will now have the output from the script in C:\Script\output.txt.

To restore an object named Daniel Svensson:
get-adobject -filter ‘name -like “Daniel Svensson*”‘ -IncludeDeletedObjects | Restore-ADObject

To test the restore you can use –whatif.
get-adobject -filter ‘name -like “Daniel Svensson*”‘ -IncludeDeletedObjects | Restore-ADObject –whatif

DNS Manager freezes when trying to delete/remove name server

When you try to remove a name server in the name server tab in DNS Manager you get the question “Do you want to delete the glue record” and then DNS Manager stops responding/freezes. I got this problem on a Windows 2008 R2 SP1.

Solution
Microsoft has a hotfix that solved my problem. Check out this link: DNS Management snap-in console stops responding when you edit the Name Servers tab in Windows Server 2008 R2.