Skip to content

emrgcl/PSBox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8b96c40 · Sep 30, 2020

History

69 Commits
Mar 21, 2019
Jan 5, 2020
May 26, 2019
Nov 27, 2018
Oct 8, 2019
Aug 1, 2019
Feb 14, 2019
Nov 29, 2019
May 26, 2019
Aug 6, 2019
May 26, 2019
Nov 13, 2018
Sep 6, 2019
Sep 24, 2019
Dec 26, 2019
Feb 14, 2019
Mar 5, 2020
Mar 19, 2020
Apr 9, 2019
Oct 18, 2018
May 1, 2020
Mar 5, 2020
Sep 30, 2020
Oct 21, 2019
Jun 17, 2019

Repository files navigation

TODO

  • Testtodo
  • completed todo

PSBox

Powershell Scripts for Everyone

Test-PSRemoting.ps1

This script tests PowerShell Remoting using Test-WSMan cmdLet and returns a Custom PSobject with ServerName and Result.

You can use this script in large sets of servers. In an environment of 500 servers script ends around 3 minutes.

Examples

  • Pipe from SCOM
get-scomagent | .\test-psremoting.ps1 -HideSuccess | export-csv -Path c:\temp\wsmanresult.csv
  • Pipe From a text file and group object to make a summary report
get-content | .\test-psremoting.ps1 | Group-Object -PropertyName ErrorCode
  • Dont pipe just provide the Server Names
.\test-psremoting.ps1 -ServerName "server1","server2","server3"

Disable-SCOMCollection.ps1

ListSCOMObjects.ps1

Lists the objects of a class and parses the path so that the every single parent host is reported on the object. Great to check the number of instances of a class on a Server.

Examples

  • Lists the objects and formats as table
.\ListSCOMObjects.ps1 -ManagementServer ms1fqdn -Class "sql database" | ft -AutoSize
powershell 

OjectHost1   ServerName                Object                                                                                  AgentHealth  ObjectHealth
----------   ----------                ------                                                                                  -----------  ------------
MSSQLSERVER  cccc.litware.com	         cbslog                                                                                          True       Success
MSSQLSERVER  tststst.litware.com       ETA_KKST_2015                                                                                   True       Success
WINCCT        test1.litware.com        DB1                                                                                             True       Success
MSSQLSERVER  WWWSQL1.srvdmz.com        DB2                                                                                             True       Warning
MSSQLSERVER  tstFGSDB.litware.com      DBXXX                                                                                           True       Success
SQLT1        MSSQLXX1.litware.com      prjtest                                                                                         True       Success
MSSQLSERVER  yyyy.litware.com          KOTAX                                                                                           True       Success

Install-SCOMAgent.ps1

Installs scom agent without any controls or checks (yet:))