scautomation / Document-SCOM-Distributed-Aps

a powershell script that uses Excel to produce a document of distributed applications in your environment
5 stars 0 forks source link

Issue with credentials - "securestring" not working #1

Closed woodyeire closed 5 years ago

woodyeire commented 5 years ago

Hi!

First of all, incredible script, great work.

I had one issue in actually running the script, no matter what I tried it would not accept my credentials. I tried every variation of it, with domain prefix, without, just password etc.

I kept getting errors in the Powershell Window; something to the effect of, "Could not convert String to securestring" etc.

I got around this by changing the below datatype from "securestring" to "PSCredential".

# Mandatory credentials for access SCOM Remotely
    [parameter(Mandatory=$true)]
    [System.Management.Automation.PSCredential]$credential, 

I then used "$cred = Get-Credential" and passed this through which worked a charm. Just thought I'd point it out in case anyone else comes across this issue.

Also, I had one issue where the same components have been input to three different sheets for different DA's. My guess is that some variable didn't dump data before moving on to the next iteration but I haven't got around to identifying it properly yet.

I have 300+ DA's in my environment which all have multiple layers of groups and components, so its not a straight forward one!

Thanks

scautomation commented 5 years ago

Hey i just saw this, somehow didn't get notified of the issue. I went ahead and made the PScredential change. if you figure out what's causing your other issue let me know. I had a helluva time getting all the data right with how many loops there are in this script, so it wouldn't surprise me if there are a few things that are still off.