I
iSiek
Guest
Hello guys,
I cannot find resolution for my problem and I've decided to ask community for support.
Short background. I am writting an application in C# with .NET 4.5
For that I am using System.DirectoryServices.ActiveDirectory namespace.
All I need is to allow user transferring FSMO role from one server to another. Everything is fine for these roles:
I can simply transfer them back and forth between selected Domain Controllers without any issue. Infrastructure complexity does not matter (single forest, single domain or single forest, multiple domain enviroment)
The problem begins when I want to transfer PDC Emulator master role. It fails in 100% attempts.
This is not related with lack of permissions. I can use ADUC or PowerShell cmd-lets to successfully transfer the role. I cannot do this only from C# code.
To simplify support request, please have a look at below code snippet
using (DomainController dc = DomainController.GetDomainController(new DirectoryContext(DirectoryContextType.DirectoryServer, "DC2")))
{
dc.TransferRoleOwnership(ActiveDirectoryRole.PdcRole);
}
where DC2 is a Domain Controller to which the role should be transferred.
That is the error showing up
************** Exception Text **************
System.InvalidOperationException: The server is unwilling to process the request.
---> System.DirectoryServices.DirectoryServicesCOMException: The server is unwilling to process the request.
at System.DirectoryServices.DirectoryEntry.CommitChanges()
at System.DirectoryServices.ActiveDirectory.DomainController.TransferRoleOwnership(ActiveDirectoryRole role)
--- End of inner exception stack trace ---
at System.DirectoryServices.ActiveDirectory.DomainController.TransferRoleOwnership(ActiveDirectoryRole role)
This error is not telling me much as you can see.
When I try to seize role it is fine (there are no checks, previous DC is being expected to be dead). That means, some other pre-requisites must be met before PDCe role can be transferred over .NET
Would you be able to guide me how to solve this issue, please?
Of course, code snippet is simplified for troubleshooting and we do not have to bother with code's complexity in my program. If PDC Emulator role would be possible to move over this simple code, I will be able to adapt it in my program.
Thank you in advance for your support and regards,
Krzysztof
Regards, Krzysztof ---- Visit my blog at iSiek's blog about Microsoft Windows services |
Continue reading...
I cannot find resolution for my problem and I've decided to ask community for support.
Short background. I am writting an application in C# with .NET 4.5
For that I am using System.DirectoryServices.ActiveDirectory namespace.
All I need is to allow user transferring FSMO role from one server to another. Everything is fine for these roles:
- Schema master
- Domain Naming master
- RID master
- Infrastructure master
I can simply transfer them back and forth between selected Domain Controllers without any issue. Infrastructure complexity does not matter (single forest, single domain or single forest, multiple domain enviroment)
The problem begins when I want to transfer PDC Emulator master role. It fails in 100% attempts.
This is not related with lack of permissions. I can use ADUC or PowerShell cmd-lets to successfully transfer the role. I cannot do this only from C# code.
To simplify support request, please have a look at below code snippet
using (DomainController dc = DomainController.GetDomainController(new DirectoryContext(DirectoryContextType.DirectoryServer, "DC2")))
{
dc.TransferRoleOwnership(ActiveDirectoryRole.PdcRole);
}
where DC2 is a Domain Controller to which the role should be transferred.
That is the error showing up
************** Exception Text **************
System.InvalidOperationException: The server is unwilling to process the request.
---> System.DirectoryServices.DirectoryServicesCOMException: The server is unwilling to process the request.
at System.DirectoryServices.DirectoryEntry.CommitChanges()
at System.DirectoryServices.ActiveDirectory.DomainController.TransferRoleOwnership(ActiveDirectoryRole role)
--- End of inner exception stack trace ---
at System.DirectoryServices.ActiveDirectory.DomainController.TransferRoleOwnership(ActiveDirectoryRole role)
This error is not telling me much as you can see.
When I try to seize role it is fine (there are no checks, previous DC is being expected to be dead). That means, some other pre-requisites must be met before PDCe role can be transferred over .NET
Would you be able to guide me how to solve this issue, please?
Of course, code snippet is simplified for troubleshooting and we do not have to bother with code's complexity in my program. If PDC Emulator role would be possible to move over this simple code, I will be able to adapt it in my program.
Thank you in advance for your support and regards,
Krzysztof
Regards, Krzysztof ---- Visit my blog at iSiek's blog about Microsoft Windows services |
Continue reading...