Tag Archives: powershell

Powershell JEA Just Enough Administration Session client IP

To get the IP from inside a session you can use Get-WSManInstance. If you run the endpoint as a group managed service account it has to be administrator on the local machine. Otherwise you will get access denied. The variable … Continue reading

Posted in Powershell | Tagged , | Comments Off on Powershell JEA Just Enough Administration Session client IP

Sätta advanced settings på virtuella maskiner under drift

I vanliga fall när man ska sätta en ny advanced setting måste man stänga av VM:en och peta in inställningen och sedan starta upp den igen, via PowerShell/PowerCLI så kan man göra detta under full drift. Dock så kan en … Continue reading Continue reading

Posted in Powershell, Vmware | Tagged , , , , | Comments Off on Sätta advanced settings på virtuella maskiner under drift

Jämföra servernamn i textfiler med Powershell

Om man vill jämföra innehållet i 2 textfiler/arrayer kan man använda Compare-Object. Nedan finns ett exempelscript som jämför listor från AD:t och från Netbackup. #Hämtar in filen med AD innehållet och gör om alla rader till lowercase $adtemp = (Get-Content … Continue reading Continue reading

Posted in Powershell | Tagged , , | Comments Off on Jämföra servernamn i textfiler med Powershell

Starta powershellscript som Scheduled Task

Se bilden nedan för att starta ett powershellscript som Scheduled Task i Windows. Kommandot blir Powershell.exe Argumenten blir -command “& ‘D:\Script\PSScript.ps1′ “ Continue reading

Posted in Powershell | Tagged , | Comments Off on Starta powershellscript som Scheduled Task

How to make a simple delayed start for a Powershell script

This is a simple script to make a delayed start for a Powershell script.

Posted in Powershell | Tagged , | Comments Off on How to make a simple delayed start for a Powershell script

Run Powershell scripts as a Scheduled Task in Windows 2008R2

There is probobly thousands of ways you can do this and this is one of them. You must specify the Powershell script as an argument to Powershell.exe Se example In this case the executable is Powershell.exe and the arugment is … Continue reading

Posted in Powershell | Tagged , | Comments Off on Run Powershell scripts as a Scheduled Task in Windows 2008R2

Useful WinRM Commands

Check for listeners winrm enumerate winrm/config/listener Check configuration winrm get winrm/config Setup WinRM using HTTPS winrm qc -transport:https Check whether basic authentication is allowed. winrm get winrm/config Enable basic authentication. winrm set winrm/config/service/auth @{Basic=”true”} Allow transfer of unencrypted data on … Continue reading

Posted in Windows | Tagged , , | Comments Off on Useful WinRM Commands

Restore objects in Active Directory using Recycle Bin and Powershell

To see the Deleted Objects container you must run the command as Domain Administrator. This is one of many examples how to restore an object from Recycle Bin using Powershell This will return all object in Recycle Bin with the … Continue reading

Posted in Active Directory, Powershell | Tagged , , | Comments Off on Restore objects in Active Directory using Recycle Bin and Powershell