IT Knowledge Base

Technical Repository

HowTo: Powershell – Disable Drive Indexing

Create a file named Disable_Disk_Indexing.ps1 and copy and paste the following: function Disable-Indexing { Param($Drive) $obj = Get-WmiObject -Class Win32_Volume -Filter “DriveLetter=’$Drive'” $indexing = $obj.IndexingEnabled if(“$indexing” -eq $True){ write-host “Disabling indexing of drive $Drive” $obj | Set-WmiInstance -Arguments @{IndexingEnabled=$False} | Out-Null } } #Use: #Disable Drive Indexing on C:\ Disable-Indexing “C:” Don’t forget to set […]

Read More


HowTo: Powershell – Clear All Windows Event Logs

wevtutil clear-log Application wevtutil clear-log Security wevtutil clear-log Setup wevtutil clear-log System or wevtutil el | foreach { wevtutil cl $_ }

Read More


HowTo: Powershell – Using the Get-Child Cmdlet

Here’s a quick tip on working with Windows PowerShell. These are published every week for as long as we can come up with new tips. If you have a tip you’d like us to share or a question about how to do something, let us know. Fun Things You Can Do With the Get-ChildItem Cmdlet […]

Read More


HowTo: Exchange 2010/2013 – Give user full access to all mailboxes

Give access to all mailboxes Get-Mailbox | Add-MailboxPermission -User gmatteson -AccessRight FullAccess -InheritanceType All -Automapping $false Remove access to all mailboxes Get-Mailbox | Remove-MailboxPermission -User gmatteson -AccessRights FullAccess This cmdLet can be used to give a user full access permissions to all mailboxes in Exchange and to all future mailboxes that will be created. Get-MailboxDatabase […]

Read More


HowTo: Powershell – Restart All Lync 2013 Services

If you need to restart all of the Lync services on a Lync Server, you can use powershell to start and stop them all rather than using the Services.msc to do this one by one. Stop all Lync Services: Stop-CsWindowsService Start all Lync Services: Start-CsWindowsService

Read More


HowTo: SQL Server 2008/2012 – Determining how long a database will be in RECOVERY

If you SQL Server crashed in the middle of a transaction, you can use the following queries to get a rough idea as to how much time is left in the RECOVERY stage before the database is consistent again. DECLARE @DBName VARCHAR(64) = ‘databasename’ DECLARE @ErrorLog AS TABLE([LogDate] CHAR(24), [ProcessInfo] VARCHAR(64), [TEXT] VARCHAR(MAX)) INSERT INTO […]

Read More


HowTo: Get the LastLogonTime to a mailbox for a user on Exchange 2013

If we want to check when a user last logged on to their mailbox in Exchange 2013 you need to run the following cmdlet: Get-MailboxStatistics [email protected] | Select DisplayName, LastLoggedOnUserAccount, LastLogonTime or to view the statistics for all mailboxes Get-Mailbox | Get-MailboxStatistics | Select DisplayName, LastLoggedOnUserAccount, LastLogonTime

Read More


Troubleshoot: Lync 2013 – Event Error 21054

http://technet.microsoft.com/en-us/library/jj205120.aspx Address Book Server error event 21054 is generated once daily for each Lync 2013 pool (3195918) Issue: Lync Server 2013 Address Book Server will generate error event 21054 once every day when performing daily maintenance. The error is also generated every time an administrator runs the Update-csAddressBook cmdlet, even when the update is successful. […]

Read More


HowTo: Windows 2012 R2 – Fix Domain Controller SRV Records

nltest /dsregdns net stop netlogon net start netlogon

Read More


HowTo: Exchange 2013 – Receive Connector – Configure a SMTP Relay

1. Log into the Exchange Control Panel and navigate to Mail Flow > Receive Connectors. 2. Click the + icon to create a new receive connector. 3. Under Name, type in Outbound Relay. Under Role, select Frontend Transport and under Type select Custom and click Next. 4. By default this receive connector will bind to all of the […]

Read More