I am trying to query the subnet and CIDR from the table based on a Location variable that I am providing. Does anyone know the syntax to get this same query with the Get-SwisData command instead of the Invoke-Sqlcmd which requires the logged in user to have access to the database?
this is what currently works:
$SWIS = Connect-Swis -Credential $DomainCreds -Hostname FakeSWServer
$IPQuery = "SELECT TOP 100 * FROM [dbo].[IPAM_Group] WHERE Location = '$Site'"
$SubnetResult = Invoke-Sqlcmd -ServerInstance 'solarwinds\MSSQLSERVER,1433' -Query $IPQuery -Database 'SolarWindsOrion'
$SubnetResult = Get-SwisData -Query $IPQuery -SwisConnection $SWIS
Any help would be appreciated this is the only step in my overall script that requires the logged in context, and it would be great to eliminate that.