We recently started rolling NCM out and I have needed to give the Orion Server access to our devices. As I grant the access I have been making sure that NCM can download the configs successfully by clicking "Download" for Startup and Running in the "Download Config" window on the "CONFIGS" tab of each device. I thought this would be a good opportunity to test out kicking these downloads off through PowerShell so I tried it on a list of devices but I received an Access denied for "CanDownload" permission. I have a test script shown below. What I wanted it to do was use the Connection Profile that already exists on the nodes in question (In this case it is a Cisco device). I didn't see any mention of providing credentials when using the DownloadConfig verb? The user I am connecting with can initiate the download of configs through the website using the "Download Config" window mentioned above. Can someone help me out with a basic example on backing up a config? Also, if you have other cool things you are doing with NCM through the SDK please feel free to share.
$hostname = "ncmserver.jeremy.com"
$cred = Get-Credential
$swis = Connect-Swis -host $hostname -cred $cred
$nodeIdList = New-Object -TypeName "System.Guid[]" 1
$nodeIdList[0] = '153f4679-8bdc-4478-ba95-403352f5a175'
Invoke-SwisVerb $swis Cirrus.ConfigArchive DownloadConfig @($nodeIdList, "Running")
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Invoke-SwisVerb : Access denied. CanDownload permission required.
At ...\001-Solarwinds\Scripts\NCM.Test.ps1:6 char:1
+ Invoke-SwisVerb $swis Cirrus.ConfigArchive DownloadConfig @($nodeIdLi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-SwisVerb], FaultException`1
+ FullyQualifiedErrorId : SwisError,SwisPowerShell.InvokeSwisVerb
Thanks,
Jeremy