————————————————————————————– import the certificate into the management server

To import a user certificate and private key into the Windows Certificate Store, it’s easiest if you have them packaged together in PKCS12 format (.pfx or .p12). OpenSSL can combine a separate certificate (usercert.pem or usercert.cer) and private key file (userkey.pem) into PKCS12 format using the pkcs12 command:

openssl pkcs12 -export -out usercert.p12 -in usercert.pem -inkey userkey.pem

sudo openssl pkcs12 -export -out omikey.p12 -in ./omi.pem -inkey ./omikey.pem

————————————————————————————-

$username = “root” $password = “Welkom01!” $secstr = New-Object -TypeName System.Security.SecureString $password.ToCharArray() | ForEach-Object {$secstr.AppendChar($_)} $Cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $secstr

$options = New-CimSessionOption -UseSsl -SkipCACheck

$Session = New-CimSession -ComputerName vincents-mac.local -Authentication Basic -Credential $Cred -SessionOption $options Get-CimInstance -CimSession $Session -ClassName OMI_Identify -Namespace root/omi

————————————————————————————-

## Edit the GetOSVersion.sh

## End Linux distro function

######################################################################

## Determine Version of Unix Platforms

if [ "${OSName}" = "HP-UX" ]

then

# Version=`uname -r | awk -FB. '{print $2}'`

Version=`uname -r`

OSAlias="HPUX"

elif [ "${OSName}" = "AIX" ]

then

Version=`oslevel`

OSAlias="AIX"

Arch=`uname -p`

elif [ "${OSName}" = "SunOS" ]

then

# Keeping commented code for changing "5.10" to "10"

# Version=`uname -r | awk -F. '{print $2}'`

Version=`uname -r`

OSAlias="Solaris"

Arch=`uname -p`

echo $OSName

# Get OS Name for OSX

elif [ `uname -s` = "Darwin" ];

then

 OSName="OS X"

 OSAlias="Darwin"

 Hostname=`uname -n`

 Version=`sw_vers -productVersion`

 Arch=`uname -m`

 IsLinux="false"

## If the OS is Linux, then we need to call the function to get our data

elif [ "${OSName}" = "Linux" ]

then

GetLinuxInfo

else

echo "Unknown"

exit 0

fi

## Format in XML ouput readable by OpsMgr

echo "${Hostname}${OSName}${OSAlias}${Version}${Arch}${IsLinux}"

 

————————————————————————————-