Message 1 of 4
PowerShell - Authenticating using Windows credentials
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Has anyone any experience of connecting to Vault via PowerShell, but using Windows credentials?
For example, the following code throws an error "New-Object : Exception calling ".ctor" with "1" argument(s): "311""
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
[System.Reflection.Assembly]::LoadFrom('C:\Program Files (x86)\Autodesk\Autodesk Vault 2019 SDK\bin\x64\Autodesk.Connectivity.WebServices.dll')
$serverID = New-Object Autodesk.Connectivity.WebServices.ServerIdentities
$serverID.DataServer = "MYSERVER"
$serverID.FileServer = "MYSERVER"
$VaultName = "MYVAULT"
$cred = New-Object Autodesk.Connectivity.WebServicesTools.UserPasswordCredentials ($serverID, $VaultName, $true)
$vault = New-Object Autodesk.Connectivity.WebServicesTools.WebServiceManager($cred)
The only thing I found online was this https://github.com/miwaniza/Autodesk_Vault_Programmers_Cookbook/blob/master/2.%20Login/1.3.%20Window...
But it would seem to suggest that I don't need to pass my username and password to UserPasswordCredentials when authenticating using Active Directory.
Using simple username/password authentication as per this (https://forums.autodesk.com/t5/vault-customization/here-is-a-working-windows-login-to-vault-but-how-...) does not work either.
Any ideas?
