Skip to main content

Posts

Changing the Account Expiration Date on all Users with PowerShell

This is a question that I took from PowerShell.com and presented to my PowerShell class.  My intent was to demonstration some research methods using MSDN.  In truth, I had no idea how complicated that this could be. The user needed to advance all user account expiration dates by 90 days from the current date.  Take a look at the AccountExpires property.  I did a little internet research on the properties of an Active Directory User Object. Here is what I found out about the AccountExpires attribute .  It is the number of 100-nanosecond intervals from January 1, 1601.  OK, who thinks of this stuff?  I was hoping this would be a System.DateTime object, but we are not so lucky.  So, I set off to make it one. Another issue is once I have it in a DateTime object, how do I change it back into this 100-nanosecond format? Doing a little research of the DateTime object on MSDN gave me the class information for this object.   Clicking on the...

How to Turn off Chinese Input Method in Windows 8

Recently while delivering a PowerShell class, I received a real shock from Windows 8.  Take a look at the image below. It was also interfering with PowerShell’s Autocomplete feature.  I automatically assumed that I accidently triggered a Windows 8 keyboard shortcut that I was not aware of.  To enable or disable this feature, press Ctrl + Space .

How to Get a Users UserAccountControl Setting from Active Directory Without Using the ActiveDirectory PowerShell Module

While delivering a PowerShell class, it came to light that the users of PowerShell were not going to have access to the ActiveDirectory module.  This changes a lot.  The AD module is full of useful cmdlets to help make a Network Administrators life easier.  as a matter of fact, I did not move to PowerShell from AD administration until I PowerShell V2 and the ActiveDirectory module were available to me. One of the more cryptic properties that can be pulled from the user account object is the UserAccountControl property.  Here is a description of the flags that can be set with this property. (Source: http://support.microsoft.com/kb/305144 ) SCRIPT - The logon script will be run. ACCOUNTDISABLE - The user account is disabled. HOMEDIR_REQUIRED - The home folder is required. PASSWD_NOTREQD - No password is required. PASSWD_CANT_CHANGE - The user cannot change the password. This is a permission on the user's object. For information about how to programmatically set ...

What Snap-ins are required to access the Exchange Cmdlets?

PowerShell utilized both Snapins and Modules to expand its functionality.  For those of you needing to do some exchange scripting, you will need access to the Exchange Snapins.  These snap ins are installed on your Exchange server.  If you would like to work off of a client, then use the Exchange installation media to install the Exchange Management Tools to your client.   These snapins are for Exchange 2010. Microsoft.Exchange.Management.PowerShell.E2010 Microsoft.Exchange.Management.PowerShell.Setup Microsoft.Exchange.Management.PowerShell.Support   To register these snapins quickly in the ISE, type this command in the Command window: Get-PSSnapin –Registered | ForEach-Object {Add-PSSnapin –Name $_.Name}

How to Exceed the Maximum Number of Allowed Objects from Get-ADGroupMember, Get-ADPrincipalGroupMembership, and Get-ADAccountAuthorizationGroup cmdlets

One of the reason why the cmdlets in the ActiveDirectory module limit the properties from objects or the number of objects returned is because you may accidentaly ask for 2 billion objects if you are not careful.  A recent question from one of my posts asked about how to exceed the threshold for Get-ADGroupMember.  The error that the user received was: Get-ADGroupMember : The size limit for this request was exceeded The default limit is 5000 objects.  This is a limitation imposed by the Active Directory Web Service.  ADWS is a requirement for utilizing the ActiveDirectoy module for PowerShell. If you have multiple instances on ADWS on multiple Domain Controllers, you will need to perform this procedure on each one.  Since you do not know for sure which DC your client will bind to, changing this setting on all of the ADWS services will prevent random issues from happening in the future. On the file c:\Windows\ADWS\Microsoft.ActiveDirectory.WebServices.exe.con...

How to Stop Background Windows from Popping Up in Windows 8

Recently I purchased a Windows 8 laptop as part of my normal 3 year hardware refresh.  Love it.  It is nice and fast.  I installed Office Professional Plus 2013 without any issues.  When I was asked to deliver a virtual class using Lync, I had an issue.  A quick fix was to uninstall Lync 2013 and just use the web based client.  That is when it all started. Out of the blue, windows in the background, or even minimized, would pop up and take focus. It was very embarrassing to have to deliver a class when I could barely maintain control of my own system.  Here is how I fixed it. Open Programs and Features. Select Microsoft Officer Professional Plus 2013 and then click Change . Select to Repair your installation.  I am happy to say, no more issues.

What to do if the Shift Key Gets Stuck in a Hyper-V Session

It happened again.  I was doing a demonstration in a class and my shift key got stuck inside of the Virtual Machine Connection windows for Hyper-V.  Normally these leads to a reboot of the VM.  Fortunately, one of my students found a much better work around.  Simply Pause the VM and the Resume it.  The Pause and Resume buttons are in the same place on the menu bar.   This quick and effective work around should make this random issue a bit easier to work with.