Skip to content

Instantly share code, notes, and snippets.

@MSAdministrator
Created February 1, 2016 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MSAdministrator/e3eb330e540d21f32cd2 to your computer and use it in GitHub Desktop.
Save MSAdministrator/e3eb330e540d21f32cd2 to your computer and use it in GitHub Desktop.
function Test-QualysAuthentication ()
{
[cmdletbinding()]
param (
[parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
HelpMessage="Please provide a credential obejct")]
[ValidateNotNullOrEmpty()]
[System.Management.Automation.CredentialAttribute()]$credential
)
<#
.SYNOPSIS
This function tests your Qualys VM API Credentials
.PARAMETER Credential
Specifices a set of credentials used to query the QualysGuard API
.EXAMPLE
C:\PS> $cred = Get-Credential
C:\PS> Test-QualysAuthentication -credential $cred
#>
[xml]$hostinfo = Invoke-RestMethod -Uri "https://qualysapi.qualys.com/msp/get_host_info.php?host_netbios=$netbios&general_info=1" -Credential $credential
return $hostinfo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment