Browsed by
Tag: Powershell

PSScriptAnalyzer

PSScriptAnalyzer

PSScriptAnalyzer is a static code checker for Windows PowerShell modules and scripts. PSScriptAnalyzer checks the quality of Windows PowerShell code by running a set of rules. The rules are based on PowerShell best practices identified by PowerShell Team and the community. It generates DiagnosticResults (errors and warnings) to inform users about potential code defects and suggests possible solutions for improvements.

Detect elevated privileges

Detect elevated privileges

Sometimes you get a requirement to start a Powershell script from an elevated prompt. Here is a quick function to check that :

 

function Test-ElevatedPrompt {                      
 [Security.Principal.WindowsPrincipal] $Identity = [Security.Principal.WindowsIdentity]::GetCurrent()            
 $Identity.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)            
}

This will return a simple boolean so you can use it this way :

 

Audit uptime of all servers

Audit uptime of all servers

Monitoring servers is an important thing, almost uptime of all servers.  You should have some dedicated tools such as Zabbix, Nagios, etc… BUT ! Here is a script to generate an HTML report of all your servers uptime.

Those servers are all registered into AD and the ‘get’ is based on the operating system detected by AD.

Import calendar event through impersonation – O365

Import calendar event through impersonation – O365

Sometimes, for several reasons, you’ll have to import calendar events into users mailbox in O365.

That could be done using different methods, directly using a service account (with a mailbox !), impersonated (as if the user created the event).

Here below is a quick example of a small script (powershell of course ! )

POWERSHELL CONFERENCE EUROPE 2018

POWERSHELL CONFERENCE EUROPE 2018

http://www.psconf.eu/

PowerShell Conference Europe is the largest PowerShell-themed conference in Europe, and is held in Hanover, Germany each year. We attract speakers and attendees from all over the world, with such topics as security, DevOps, databases, core language features, optimization, DSC, best practices and much more.

How to whitelist website on AdBlocker?

How to whitelist website on AdBlocker?

  1. 1 Click on the AdBlock Plus icon on the top right corner of your browser
  2. 2 Click on "Enabled on this site" from the AdBlock Plus option
  3. 3 Refresh the page and start browsing the site