Tuesday, November 28, 2017

“The RPC server is unavailable” while trying to take Remote Desktop of 2003 Server

When trying to logon to Windows server 2003 via remote desktop you receive the following message:

The system cannot log you on due to the following error:
The RPC server is unavailable.
Please try again or consult your system administrator.

You will also receive the following event in the target server’s application event log:

Event ID: 1219
Logon rejected for Domain\User. Unable to obtain Terminal Server User Configuration. Error: The RPC server is unavailable.

To resolve this :

1. Locate the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
2. Create a new DWORD called IgnoreRegUserConfigErrors
3. Give it a value of 1

Source

Friday, November 10, 2017

ADD extensionAttribute

If you have different upn names , than your domain server name and you need to use different upn-s for ldap queris you can add sammaacountname + server domain name to custem attributes.

In file atribute.txt write users sammaccountnames.

Import-Module ActiveDirectory
$Users = Get-Content c:\tmp\atribute.txt
ForEach ($User in $Users) {
$username = Get-ADUser -Server test.local -Identity "$user" -Properties  samaccountname |select -ExpandProperty samaccountname
Set-ADUser -Server test.local -Identity "$user" -Add @{extensionAttribute13="$Username@test.local"}
}