Please can you re-send the security error in this thread as well, to see it in the context?
The error is:
Get-SwisData : An error occurred when verifying security for the message.
At line:1 char:1
+ Get-SwisData $swis 'SELECT TOP 1 I.Status, I.DisplayName FROM IPAM.IP ...
+ CategoryInfo : InvalidOperation: (:) [Get-SwisData], MessageSecurityException
+ FullyQualifiedErrorId : SwisError,SwisPowerShell.GetSwisData
It would seem you are using
$swissconect and $swis somewhere as well as the connection string ? (+ Get-SwisData $swis 'SELECT TOP 1 I.Status, I.DisplayName FROM IPAM.IP ...) hence the connection string is wrong
in the example above you are using $swisconnect ?
In the example above (that I ran yesterday) I used $swis as the variable for my connection. In my original I used the variable swisconnect or w/e. In the case above:
$swis = connect-swis -host SOLARWINDS -cred (Get-credential)
SOLARWINDS needs to be a variable.
Connect-Swis -host $hostname -cred $cred
not quite sure when you are getting the error as this is different to the above one? are you getting it in both cases?
ive been using:
$swis = Connect-Swis –Trusted –Hostname localhost which uses a token instead.
Hostname being a variable doesn't make sense - whether its a variable or a string it's the same object. Either way it still errors ou remotely.
Running it locally and using the trusted flag did work. So I'll just go with that for now. Thanks.
It needs to know the host its connecting to hence it being on the right side IE
$hostname = "server.hostname"
you can do the following where the credentials are got from the user via a pop up box, remember though its the same format as you log into your domain with so domain\username
$cred = Get-Credential
$swis = Connect-Swis -host $hostname -cred $cred
hope that helps