I recently needed to create a .csv file showing all permissions that users had to each others mailboxes (including shared).
Continue reading “Find Users that have permissions to regular and shared mailboxes”
DailySysAdmin | For all things IT!
A resource for Sys Admins & IT Pros
I recently needed to create a .csv file showing all permissions that users had to each others mailboxes (including shared).
Continue reading “Find Users that have permissions to regular and shared mailboxes”
To get a user report including all of the groups that each user is a member of use:
Import-module activedirectory Get-AdUser -Filter * -Properties * | select DisplayName, Title, Department, Manager, @{N=’Groups’; E={$($_.Memberof)}} | Export-csv "c:\temp\UsersandGroups.csv" -nti
To convert a mailbox to a shared or other type of mailbox just use the below command:
Continue reading “Convert a mailbox to a shared or other mailbox type”
Problem:
A client needed to find and remove all of the largest items withing their Exchange databases using PowerShell.
Continue reading “Find large items in Exchange 2010 Using PowerShell”
This is a very useful line of code that will list all of the members of a particular Active Directory group and send the output to a .csv file.
Get-ADGroupMember -Identity "Test Group" | export-csv c:\temp\GroupMembers.csv
If you want to find out when user’s passwords will expire and export them to a .csv file then this will help. This simple script will list all of your active users, sort the list and list the expiry dates.
Import-Module ActiveDirectory Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} –Properties "SamAccountName","msDS-UserPasswordExpiryTimeComputed" | Select-Object -Property "SamAccountName", @{Name="Password Expiry Date"; Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}} | sort "SamAccountName" | export-csv c:\temp\expire.csv -NoTypeInformation
You can also modify the script so that all you need to do is enter the username and get the expiry date:
Import-Module ActiveDirectory Add-Type -AssemblyName Microsoft.VisualBasic $username = [Microsoft.VisualBasic.Interaction]::InputBox('Enter users SamAccountName', 'SamAccountName') Get-ADUser $username –Properties "SamAccountName","msDS-UserPasswordExpiryTimeComputed" | Select-Object -Property "SamAccountName", @{Name="Password Expiry Date"; Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}} | sort "SamAccountName" | Out-GridView
If you are running the script from a desktop machine ensure that PowerShell is running as admin and that you have the RSAT tools installed.