Get-credential - Save local account credentials

Hello All,

I am trying to save a local account credentials with account name like “.\administrator” and it seems to be not acceptable with get-credential, can someone help me .

What task do you try to achieve with that? There might be a better way. :wink:

And what does " it seems to be not acceptable" actually mean?

Hi @Olaf ,

Actually I am trying to use the below script to rejoin the VDI back to domain and I am giving input for local credentials as “.\administrator” and it shows the attached message.

 Rejoin-Computer -Computername 'COMPUTER1' -DomainName 'mydomain.local'  -UnjoinLocalCredentialXmlFilePath 'C:\LocalAdminCred.xml'  -JoinDomainCredentialXmlFilePath 'C:\DomainCred.xml' -Verbose 

Actually this administrator credential is same in other computers which I also need to rejoin, so I haven’t gave the name as “computer\administrator”

what is the common format , if any, for such case ?

I don’t know the cmdlet Rejoin-Computer. Usually you add a computer to a domain by running the command Add-Computer with the account of the local administrator. So there shouldn’t be a need to specify any credentials for the local administrator.

Actually I wasn’t logged into the computer, does it works remotely ?

Olaf, have a look here … I think this is what is being used:


I actually do not care about it. :man_shrugging:t4: @Rahul20 should take a look at it. :+1:t4:

We use SCCM for OS deployments what’s including the domain join. So I don’t have use case for those scripts. :wink: :slightly_smiling_face:

Understood. You seem to go out of your way to help folks, just thought that might help.

Well … I hope it will help @Rahul20. :wink:

Anyway, thanks for link. :+1:t4: