Geeks With Blogs
Michel Klomp Monitoring and Scripting March 2011 Entries
Logparser and Powershell
Logparser in powershell One of the few examples how to use logparser in powershell is from the Microsoft.com Operations blog. This script is a good base to create more advanced logparser scripts: $myQuery = new-object -com MSUtil.LogQuery $szQuery = “Select top 10 * from r:\ex07011210.log”; $recordSet = $myQuery.Execute($szQuery) for(; !$recordSet.atEnd(); $recordSet.moveNext()) { $record=$recordSet.getRecor... write-host ($record.GetValue(0) + “,”+ $record.GetValue(1)); } $recordSet.Close(); Logparser ......

Posted On Tuesday, March 15, 2011 3:45 AM

Creating a two-way Forest trust with Powershell
Here is a small Powershell script for creating a two-way forest trust. $localforest = [System.DirectoryServices.A... $strRemoteForest = ‘domain.local’ $strRemoteUser = ‘administrator’ $strRemotePassword = ‘P@ssw0rd’ $remoteContext = New-Object System.DirectoryServices.Ac... $strRemoteForest,$strRemote... $remoteForest = [System.DirectoryServices.A... $localForest.CreateTrustRel... ......

Posted On Tuesday, March 15, 2011 3:44 AM

Send on behalf for Multiple users on a mailbox
the following snippet can be used to add more than one user to the grantsendonbehalfto property with Powershell and the Exchange Management Shell get-mailbox dummy |set-mailbox -grantsendonbehalfto “testuser3″ $a = get-mailbox testuser2 | select-object grantsendonbehalfto $b = get-mailbox dummy| select-object grantsendonbehalfto $a.grantsendonbehalfto += $b.grantsendonbehalfto[0] get-mailbox testuser2 |set-mailbox -grantsendonbehalfto $($a.grantsendonbehalfto) ......

Posted On Tuesday, March 15, 2011 3:43 AM

Copyright © Michel Klomp | Powered by: GeeksWithBlogs.net