Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Exchange Reconciliation using Win-PS Connector

Kramerica
New Contributor II
New Contributor II

Has anyone used Win-PS connector to reconcile Exchange mailboxes (Exchange Online or On-Premise) in to Saviynt?

 

$pass=convertto-securestring $Password -asplaintext -force; $mycred=new-object -typename System.Management.Automation.PSCredential -argumentlist 'AD\SaviyntAdmin',$pass; $Session=New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchange.server.com/powershell/ -Authentication Kerberos -Credential $mycred; $ses=Import-PSSession $Session -DisableNameChecking -AllowClobber; Get-Mailbox -IgnoreDefaultScope -ResultSize Unlimited | Where{$_.SamAccountName -like 'A*' -or $_.SamAccountName -like 'B*'} |Select ExchangeGuid,SamAccountName,UserPrincipalName,WhenMailboxCreated,AddressListMembership,Alias,DisplayName,PrimarySmtpAddress,RecipientType,RecipientTypeDetails,WindowsEmailAddress,GrantSendOnBehalfTo,Name,DistinguishedName,Guid,EmailAddressPolicyEnabled,HiddenFromAddressListsEnabled; Remove-PSSession * -ErrorAction SilentlyContinue

 

We are planning to use above script to reconcile accounts. Has anyone done similar recon? Are there any other recommendations?

7 REPLIES 7

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @Kramerica,

You can try putting the powershell script under WINCONNECTOR,
"SCRIPT_TO_EXECUTE_JSON"

[ "Script=\$pw = convertto-securestring 'password1234' -asplaintext -force;\$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist 'khalid.akhter',\$pw;Invoke-Command -ComputerName 'saviyntdc01' -Credential \$mycred -ScriptBlock {Get-WmiObject -Class Win32_UserAccount | select -First 100}"]

"DATA_MAPPING_JSON"  for mapping the attributes

{
            "Name": "ACCOUNTS.NAME",
            "SID": "ACCOUNTS.ACCOUNTID",
            "Description": "ACCOUNTS.DESCRIPTION",
        "__NAMESPACE": "ACCOUNTS.CUSTOMPROPERTY1",
        "Disabled": "ACCOUNTS.CUSTOMPROPERTY2",
        "FullName": "ACCOUNTS.CUSTOMPROPERTY3",
        "Lockout": "ACCOUNTS.CUSTOMPROPERTY4",
        "Status": "ACCOUNTS.CUSTOMPROPERTY5",
        "PasswordExpires": "ACCOUNTS.CUSTOMPROPERTY6",
        "PasswordRequired": "ACCOUNTS.CUSTOMPROPERTY7",
        "Path": "ACCOUNTS.CUSTOMPROPERTY8",
        "Caption": "ACCOUNTS.CUSTOMPROPERTY9",
"__PATH": "ACCOUNTS.CUSTOMPROPERTY10"
}

Thanks

If you find the above response useful, Kindly Mark it as "Accept As Solution".

@sudeshjaiswal  Thank you for getting back. I am using a similar way to achieve this and making REST call to get the data back. I have attached importAccountJSON for your reference. Is there a way to do pagination here, since I am using the REST call? can you please advise looking at my account JSON.

[This message has been edited by moderator to mask IP]

Can you share APi response


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Please see attached. It's a JSON Array with all the fields returned.

JSON does not have details about pagination, if pagination details exists it can be achieved else not


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Fair enough. Actually that's how I have implemented it for other customers, without pagination I mean. However, for my current client, we are facing timeout issue while trying to reconcile more than 40K records using the script/configurations and Saviynt support suggested to implement pagination which didn't make sense to me, so I asked the forums. When I configure script to return 20K records, it works but with 40K it fails with timeout issue. Even though, every timeout configured is adequate.  I can see that our script is returning 40K records in 7 minutes. So not sure where the bottle neck is.

reduce the columns which are only required.


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.