Posted in General

Some quick command line tools for AD

1. To quickly list all the groups in your domain, with members, run this command: dsquery group -limit 0 | dsget group -members –expand 2. To find all users whose accounts are set to have a non-expiring password, run this command: dsquery * domainroot -filter “(&(objectcategory=person)(objectclass=user)(lockoutTime=*))” -limit 0 3. To list all the FSMO role holders in your […]

How can I kill RDP sessions from the command line?

If you have hung RDP sessions on a server that you want to kill without rebooting it, run the following: regsvr32 query.dll [enter] You only have to do this the first time. query session /server:servername [enter] reset session # /server:servername [enter] Let me know if this little quick tip helps you at AIR-SENEGAL-INTERNATIONAL.

How to reset the Search Index in Exchange 2010 Search

Exchange 2010 has a built in search feature which allows you to quickly search for emails in your mailbox using Outlook (when Online), OWA, Exchange ActiveSync etc. Exchange 2010 search indexes items as soon as they are received by the Mailbox Database. So if you’ve just transitioned from Exchange 2003 to 2010, Exchange may not […]

How can I remotely enable Remote Desktop to connect to a remote PC

Occasionally you need to get something done on a remote computer (or a clients computer) but the computer doesn’t have an easy way for you to connect to it. Luckily, if you have admin rights to the remote computer, you can still connect without needing to turn on remote desktop before hand. To do that […]

Why can I not access administrative shares from Windows 7 or Windows 8 ?

Someone asked me about this recently. They had a Windows 8 laptop and a Windows 7 desktop and no matter what they tried, they were unable to access the C$ on either the laptop or the desktop. They were 100% sure they were using the correct credentials but for whatever  reason, Windows would not accept […]

How can I suspend a VM on VMware workstation via Powershell ?

As there is no API for Powershell in VMware worksation, we need to use the built-in tool called ‘vmrun.exe” This utility can be used to control virtual machines and allows the following operations: start (power on), stop (power off), reset (reboot), suspend (but allow local work to resume), pause (without interrupting), and unpause (continue) =====Suspend […]

How can I stop Outlook 2010 from automatically mapping all my full-access mailboxes ?

In Exchange 2010 Service Pack 1 (SP1) Exchange introduced a feature that allows Outlook 2007 and Outlook 2010 clients to automatically map to any mailbox to which a user has Full Access permissions. If a user is granted Full Access permissions to another user’s mailbox or to a shared mailbox, Outlook automatically loads all mailboxes […]

How can I remove hidden network adapters from my Hyper-V / VMware Windows Virtual Machine

When using Windows based virtual machines, especially those deployed from templates, you may occasionally receive the notification “The IP address XXX.XXX.XXX.XXX you have entered for this network adapter is already assigned to another adapter” This issue occurs if a network adapter with the same IP address is in the Windows registry but is hidden in the Device Manager (My Computer […]

How can I create / name a folder with today’s date?

This is very handy if you are using scripts to generate daily logs and would like to put them in a folder with the current date. You can, of course, tweak the commands to suit your requirements:   for /F “tokens=1-4 delims=/ ” %%A in (‘date /t’) do ( set DateDay=%%A set DateMonth=%%B set DateYear=%%C […]

Why does my Windows 2008 server keep loosing its gateway IP?

I have come across this issue and it seems most common in virtual machines. The fix I found is: Logon to the server (using ILO or virtual console) NIC settings (and write down all settings) Open a CMD prompt with elevated permissions (“Run as Administrator”) Run the command: netsh int ip reset Reboot the server […]