Windows PowerShell

Play with node-powershell!

Posted on

#iHeartPowerShell One of my colleague asked me a PowerShell script to query AD User information! Yes, I did your voice! Import-Module ActiveDirectory Get-ADUser -Identity <samaccountname> But, he asked “How will I do it in NODE JS with no AD Module?” Well! it’s too deep to discuss about node js! Anyways to make it simple I […]

Windows PowerShell

Create a HPSM9 incident with an attachment using PowerShell

Posted on

  One of our valuable customer asked a script to create a HPSM9 incident with a screen shot! Yes, it is really easy if we understand the WSDL! With no wait here is the snippet #region Attaching a screen shot $Stream = [System.IO.MemoryStream]::new() $Image = [System.Drawing.Bitmap]::new(“C:\Temp\Pictures\easy.jpg”) $Image.Save($Stream, [System.Drawing.Imaging.ImageFormat]::Jpeg) $Stream.Close() $ImageBytes = $Stream.ToArray() $Attachment = New-Object […]