https://gallery.technet.microsoft.com/scriptcenter/Get-Missing-SCOM-c08b1f11
Category Archives: Scom Tips
SCOM 2012 Linux Agent gray and critical – Requires uninstall of agent & cert
Notes from our Linux admin on what he did when WSManFault is gray + critical in the console from Certificate error. This was the only way we could fix this one quickly.
The cert failed because it was signed by opsmgr01 or opsmgr03 which is not a FQDN. Normally the search line of /etc/resolv.conf should have directed any dns search to the correct server but the file had been overwritten by NetworkManager. You can get around this by putting a search line in /etc/sysconfig/network-scripts/ifcfg-eth0. Here’s the procedure to fix
1. make sure “MS1” and “MS2” are pingable not as FQDNs
2 rpm -e
3. rm -rf /etc/opt/Microsoft/scx/* (necessary to remove cert)
4. reinstall scom through operations manager
If you leave out any of the above steps then it won’t work. If you are doing this in rhel5 you have to add the extra step of making sure the svcscom account has full access to all files in /etc/opt/Microsoft/scx/ssl
SCOM 2012 Batch File to Clear Health Service Cache
net stop HealthService
cd\
cd C:\Program Files\System Center 2012\Operations Manager\Server\Health Service State\Health Service Store
del *.* /F /Q
net start HealthService
SCOM 2012 Put URL into Maintenance Mode
$Time = ((Get-Date).AddMinutes(20))
$Instance = Get-SCOMClassInstance -DisplayName “http://www.google.com”
Start-SCOMMaintenanceMode -Instance $Instance -EndTime $Time -Reason “PlannedApplicationMaintenance” -Comment “Nightly Maintenance”
Script to Logoff All Disconnected Citrix Sessions
‘ Logoff Disconnected Sessions
‘ If you want to logoff active sessions as well, change the query to include
‘ cActive
On Error Resume Next
Const cActive = 0
Const cDisconnected = 4
Const strComputer = “.”
Set objWMICitrix = GetObject(“winmgmts:{impersonationLevel=impersonate}!\\” & strComputer & “\root\citrix”)
Set colItems = objWMICitrix.ExecQuery (“Select * from Metaframe_Session Where sessionstate = ” & cDisconnected)
For Each objItem in colItems
if (objItem.SessionID > 0) and objItem.SessionID then
objItem.Logoff
end if
Next
Set objWMICitrix = Nothing
VBS Script to get AD Group Members
‘Script begins here
Dim objGroup, objUser, objFSO, objFile, strDomain, strGroup, Domain, Group
‘Change DomainName to the name of the domain the group is in
strDomain = Inputbox (“Enter the Domain name”, “Data needed”, “Default domain name”)
‘Change GroupName to the name of the group whose members you want to export
strGroup = InputBox (“Enter the Group name”, “Data needed”, “Default group name”)
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
‘On the next line change the name and path of the file that export data will be written to.
Set objFile = objFSO.CreateTextFile(“C:\” & strGroup & ” – Members.txt”)
Set objGroup = GetObject(“WinNT://” & strDomain & “/” & strGroup & “,group”)
For Each objUser In objGroup.Members
objFile.WriteLine objUser.Name & ” – ” & objUser.Class
Next
objFile.Close
Set objFile = Nothing
Set objFSO = Nothing
Set objUser = Nothing
Set objGroup = Nothing
Wscript.Echo “Done”
Wscript.Echo “Please check the c: for your output file”
Recent Comments