Tag: PowerShell

Powershell – Eventlog – List Events of last N days with specific source

Querying EventLog using PowerShell. Count the number of occurences of Kerberos Entries in System Eventlog for the last 24 hours (Get-EventLog -LogName System -Source Kerberos -After (Get-Date).AddDays(-1)).Count output the all Kerberos entries in System Eventlog for the last 24 hours: Get-EventLog -LogName System -Source Kerberos -After (Get-Date).AddDays(-1)




PowerShell – Get installed/enabled Windows Features

Sometime you need to ‘clone’ the Windows feature-set of a specific server. That’s a task I’m currently working on. Using PowerShell to enumerate/list all enabled Windows Features is easy……




Use PowerShell to Back Up System State Prior to Making Changes

Did you know you can use PowerShell to back up the system state? Understanding the Computer Restore cmdlets One of the easiest ways to ensure system reliability is to create a restore point prior to making potentially damaging changes. In this way, if a problem arises, it is rather simple to roll back the changes….




Office 365–Change the password expiration policy

The default password expiration policy of Office 365 is set to 90 days. That means that users have to change their password every 90 days. I think basically this is a good and secure policy but on the other side, it can be annoying and maybe your company has an other security policy or for…




Office 365–Connect to MsOnline using PowerShell

The administration and configuration of Office 365 can done using PowerShell. To connect to the Office 365, you need the appropriate modules installed. These modules are available from Microsoft website. This article describes how to connect to Office 365 provider….




Export and Import Mailbox data to a PST file on Exchange Server 2007

This procedure describes how to export all mailboxes from one Exchange Server to a PST files and how to import the PST files to another Exchange Server in a different domain. Before you begin make sure that:…




Finding process that locks a DLL

You want to replace a dll on a system, but you get access denied, although you’re admin, have the necessary rights.. so which process is locking the particular file/library. I know, there is handles.exe from Sysinternal Suite, and plenty other tools that do the trick.But, you don’t need third-party tools to get the answer, just…




Getting registry last write time with PowerShell

All registry keys have a value associated with called the Last Write Time. This is analogous to the last modification time for a file. When ever the registry key or one if its values has been created, modified, or deleted the value is updated to the current local system time. Unfortunately, there is no Last…




Scan IP range using ping

IP scanner for the poor ones Just open up a cmd.exe and change the ip range.. C:\>FOR /L %x in (1,1,255) do ping -n 1 192.168.2.%x | find /I "reply" >> c:\temp\pingresult.txt The above command uses a FOR loop to ping each device and looks for "Reply" in the output. If there is a "Reply"…




PowerShell: About SessionConfiguration and how to change them

Remote Access Without Admin Privileges In PowerShell v.2, remote access is available only to users who hold local administrator privileges. So, even if you do have appropriate remote access to a machine, , you cannot remotely access the system if you are not an Admin. This is not a technical limitation, though, just a safe…