
Welcome to My-PowerShell.com – your friendly source for Windows PowerShell scripts, tips and code examples.
More information about Powershell http://en.wikipedia.org/wiki/Windows_PowerShell.
View number of User Accounts in AD and Mailboxes in Exchange (0)
3/02/15 •
There are a few examples to display how many users you have in AD, how many users that are enabled and also how many that are disabled. Number of User Accounts (get-aduser –filter *).count Number of Enabled User Accounts (get-aduser -filter *|where {$_.enabled -eq “True”}).count Number of Disabled User Accounts (get-aduser -filter *|where {$_.enabled -ne [...]
Recent Posts
Citrix Powershell: Useful commands for Citrix XenApp (0)
9/24/14 •
XenApp powershell commands that help to manage Citrix XenApp environment. XenApp Servers on which a given application is hosted” Get-XASession -BrowserName Notepad | select ServerName Get the list of Users currently using a published XenApp Application: Get-XASession -BrowserName notepad | select AccountName Get the computer(or client) name from where a XenApp Application is launched: Get-XASession [...]
Delete IIS logs after certain number of days (0)
7/03/14 •
Especially on Exchange servers there are a lot of OWA logs which can be found in “C:\inetpub\logs\LogFiles\W3SVC1″. This small Powershell script can be useful, it will delete IIS Log files older than 60 days get-childitem -Path C:\inetpub\logs\LogFiles\W3SVC1 -recurse | where-object {$_.lastwritetime -lt (get-date).addDays(-60)} | Foreach-Object { del $_.FullName }
Out of Office notification doesn’t work for one user (0)
7/02/14 •
I had an issue with one user whose “Out of Office” didn’t work for some reasons. In eventlog on Exchange servers I could find evenid 3004 saying the following: The Rules quota of mailbox user@domain.com has been reached and the automatic reply rules can’t be enabled or updated. Delete some existing rules or increase the [...]
Exporting All Group Policy Settings (0)
12/10/13 •
Export all GPO’s across domains in HTML or XML file. Import-Module GroupPolicy #Export to HTML Get-GPOReport -All -ReportType html -Path C:\GPO\Export\report.html #Export to XML Get-GPOReport -All -ReportType xml -Path C:\GPO\Export\report.xml Note: XML report can be opened in Excel. File -> Open, and choose the XML file. Excel will prompt on how to open the file, [...]