4

I'm trying to create a UPS sync connection using powershell. Becuase of the vagaries of our AD setup I can't use the Central Admin 'Create New Connection' function.

I am using the script below which is copied directly from the technet article on the AddSPProfileSyncConnection command and modified with our deployments data.

Add-SPProfileSyncConnection -ProfileServiceApplication 3b0a7b01-d954-4120-90b5-caa9382ebd9a -ConnectionDomain MyNETBIOS  -ConnectionForestName My.Forest.Name -ConnectionPassword convertto-securestring "Password" -asplaintext -force -ConnectionSynchronizationOU TopOU -ConnectionUserName Domain\svc_spdev_pfl -ConnectionPort 389   

When I run the script I get an error message:

Cannot bind parameter 'ConnectionPassword' Cannot convert the "convertto-securestring" value of type "System.String" to type "System.Security.SecureString".

What have I done wrong?

1
  • Try this on your password string $PlainPassword = "P@ssw0rd" $SecurePassword = $PlainPassword | ConvertTo-SecureString -AsPlainText -Force Commented Jul 16, 2014 at 8:55

1 Answer 1

8

convert the password into a varible that you can pass:

$secureString = convertto-securestring "Password" -asplaintext -force

now just use that converted secure string:

Add-SPProfileSyncConnection -ProfileServiceApplication 3b0a7b01-d954-4120-90b5-caa9382ebd9a -ConnectionDomain MyNETBIOS  -ConnectionForestName My.Forest.Name -ConnectionPassword $secureString -ConnectionSynchronizationOU TopOU -ConnectionUserName Domain\svc_spdev_pfl -ConnectionPort 389  
1
  • 1
    no probs happy to hellp! Commented Jul 16, 2014 at 10:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.