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 :

 

Read more

Welcome PowershellTips.fr !

Hi !

Roualin.fr is now PowershellTips.fr !

Same site, same kinds of tips, infos, scripts, don’t worry !

Hope you will still enjoy !

Read more

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.

Read more

Powershell parle ! (si si)

Un petit bout de code qui peut être amusant pour les débutants en Powershell, faire parler son ordinateur à l’aide de la synthèse vocale !

Add-Type -AssemblyName System.speech
$speaker = New-Object System.Speech.Synthesis.SpeechSynthesizer
$speaker.Speak("I am alive !")

Il suffit tout simplement de charger le type system “speech”, puis de charger le synthétiseur vocal, et le tour est joué !

Read 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