« And in other news... | Main | Ah yes, now I remember why we bought this townhouse. »
Sunday
18May

Anybody know why the TransferRoleOwnership() method doesn't seem to work in Powershell?

$dc.TransferRoleOwnership('PdcRole') (Or 'RidRole' or 'InfrastructureRole' or 'NamingMasterRole' or 'SchemaRole', for that matter) fails with the following error, even when I've verified that the $dc object is otherwise valid:

Exception calling "TransferRoleOwnership" with "1" argument(s): "The server is unwilling to process the request. (Exception from HRESULT: 0x80072035)"                                                                                        
At line:1 char:26                                                                                                      
+ $dc.TransferRoleOwnership( <<<< 'PdcRole') 

 


Reader Comments (6)

Perhaps it is because your using a STRING instead of the what the method request which is an ENUM of ActiveDirectoryRole

Try this

$role = [system.directoryservices.activedirectory.activedirectoryrole]::PdcRole
$dc.TransferRoleOwnership($role)

I cannot try this because I only have one DC.
btw... that error is coming from the server. It shouldnt have anything to do with Powershell.

If it weren't you asking I would say it was a user right issue :P
After further Review... It doesn't appear 2008 is supported for the .NET class. I would recommend submitting a bug/feature request into the .NET team.
Yep, looks like I'm back to LDAP operational attributes. I'm trying on the PowerShell thing, I really am. But when the .NET methods fall down and I'm back to making an LDAP call that I can do more simply with admod, it doesn't help my confidence levels. :-)
May 19, 2008 | Registered CommenterLaura E. Hunter
All that code is doing is setting the operatonal attribute. Take a trace

err 80072035
# as an HRESULT: Severity: SUCCESS (0), Facility: 0x4c5, Code 0xcd63
# as an HRESULT: Severity: FAILURE (1), Facility: 0x7, Code 0x2035
# for hex 0x2035 / decimal 8245 :
ERROR_DS_UNWILLING_TO_PERFORM winerror.h
# The server is unwilling to process the request.
# 1 matches found for "80072035"


Are you sure the "DC" object points to the right DC (e.g. the target not the source)?
May 20, 2008 | Unregistered CommenterBrian Desmond

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.