how get memberof group for specific user Powershell

get all property
Get-Aduser -identity username -properties *

get member of group
Get-Aduser -identity username -properties memberof | fl

sort output to good shape
(Get-Aduser -identity username -property memberof).memberof -replace „\,.*“

Rubriky: Active Directory, Powershell | Komentáře nejsou povolené u textu s názvem how get memberof group for specific user Powershell

Switch Over – Disaster recovery MS Exchange 2010 in Branch office

In this scenario I will show you how  easy is switch over MS Exchange from Primary office to Branch office if you lost   Primary office.

In this MS Exchange I have enable Datacenter Activate Coordination mode, but during these steps it will be not important.

command –

Set-DatabaseAvailabilityGroup -Identity DAG1 -DatacenterActivationMode DagOnly

Now we have

2 x nodes

2 locality

2 x witness

Disaster – Primary office locality lost power

DAG

 

 

logon to srv Node2 and run Powershell as Administrator.

Check if Cluster is running. If not run –

 

Net start clussvc /forcequorum

 

Stop-databaseavaibilitygroup –identity DAG1 –mailboxserver Node1 

 

Restore-DatabaseAvailabilityGroup -Identity DAG1 -AlternateWitnessServer nameofCAS -AlternateWitnessDirectory D:\path

 .

If you get power back to Primary office and turn on the servers and you will want to add server Node1 back to DAG1, run this command.

 

Add-DatabaseAvailabilityGroupServer -Identity DAG01 -MailboxServer Node1

 

Show status of DAG (………primaryActiveManager)

GetDatabaseAvailabilityGroup -status | fl

🙂



 

 

Rubriky: Others | Komentáře nejsou povolené u textu s názvem Switch Over – Disaster recovery MS Exchange 2010 in Branch office

Upgrade Server 2008 R2 Standard Edition to Server Enterprise Edition

For upgrade edition of Windows Server 2008 R2 you have to  accomplish this prerequisites:

Server is can bee upgrade from Standard to Enterprise or Datacenter , not ! Enterprise to Standard

Server can not be DC

 

dism /online /Set-Edition:ServerEnterprise /ProductKey:489J6-VHDMP-X63PK-3K798-CPX3Y

 

The key is default free KMS licence key, after this you have to activate your server again and use right enterprise key !

Server require RESTARt after run this command

I did it on the server which has hosted MS Exchange 2010 SP1 !!! and without troubles !

 

🙂

Rubriky: Exchange Server / Exchange Online, MIcrosoft Windows (client/server) | Komentáře nejsou povolené u textu s názvem Upgrade Server 2008 R2 Standard Edition to Server Enterprise Edition

Exchange DB Size, Sum of size, the largest mailboxes

**********************
Windows PowerShell Transcript Start
Start time: 20130131102344
Username : vdi.lab\amasv
Machine : EX2010-2 (Microsoft Windows NT 6.1.7600.0)
**********************
Transcript started, output file is C:\Users\amasv\Documents\PowerShell_transcript.20130131102344.txt
[PS] C:\Windows\system32>Get-MailboxDatabase -Status | select ServerName,Name,DatabaseSize

ServerName Name DatabaseSize
———- —- ————
EX2010-2 DB1 24.76 GB (26,585,137,152 bytes)
EX2010-2 DB2 24.51 GB (26,315,128,832 bytes)
EX2010-2 DB3 64.51 GB (69,272,141,824 bytes)
EX2010-2 DB4 112.4 GB (120,677,007,360 bytes)
EX2010-2 DB5 15.63 GB (16,786,194,432 bytes)
EX2010-2 DB6 28.63 GB (30,745,886,720 bytes)
EX2010-1 DB7 136.1 MB (142,671,872 bytes)
EX2010-1 DB8 5.633 GB (6,048,251,904 bytes)
EX2010-1 DB9 3.883 GB (4,169,203,712 bytes)
[PS] C:\Windows\system32>Get-MailboxDatabase -Status | select ServerName,Name,DatabaseSize | Sort-Object DatabaseSize -Descending | measure-object -Property DatabaseSize -Sum -Maximum
Count : 9
Average :
Sum : 300741623808
Maximum : 120677007360
Minimum :
Property : DatabaseSize

 

[PS] C:\Windows\system32>get-mailboxserver * | Get-MailboxStatistics | sort-object -Property totalitemsize -des | select-object displayname, totalItemSize -first 10

DisplayName TotalItemSize
———– ————-
user1 5.438 GB (5,838,972,934 bytes)
user2 5.421 GB (5,820,989,079 bytes)
user3 2.831 GB (3,040,076,803 bytes)

[PS] C:\Windows\system32>Stop-Transcript
**********************
Windows PowerShell Transcript End
End time: 20130131102532
**********************

for better sorting

| Select-Object eventid,sender,timestamp,@{Name=“Recipients“;Expression={$_.recipients}},@{Name=“RecipientStatus“;Expression={$_.recipientstatus}},messagesubject |
Export-CSV filename.csv

 

 

Rubriky: Exchange Server / Exchange Online, Powershell | Komentáře nejsou povolené u textu s názvem Exchange DB Size, Sum of size, the largest mailboxes

Get the largest mailboxes from Exchange forest

Get-MailboServer * | Get-MailboxStatistics |sort-object -Property totalitemsize -des |select-object Displayname, totalItemSize -first 10

Rubriky: Exchange Server / Exchange Online | Komentáře nejsou povolené u textu s názvem Get the largest mailboxes from Exchange forest