2013年12月23日 星期一
w32tm 網域成員電腦不信任網域主控站
網域成員電腦不信任網域主控站
w32tm /config /update /manualpeerlist:"time.stdtime.gov.tw clock.stdtime.gov.tw tick.stdtime.gov.tw tock.stdtime.gov.tw watch.stdtime.gov.tw,0x1"
w32tm /config /update
Exchange Useful Exchange Commandlets
Useful Exchange Commandlets
Get
Mailbox
Get-MailboxStatistics | where {$_.TotalItemSize -gt 1MB} | sort-object DatabaseName, TotalItemSize,LastLogonTime | format-table DisplayName, @{expression={$_.TotalItemSize.Value.ToMB()};label=”TotalItemSize(MB)”}, LastLogonTime, DatabaseName
(This will give you info on the selected users mailbox size, last login time and database)
Get-MailboxStatistics | where {$_.TotalItemSize -gt 1MB} | sort-object DatabaseName, TotalItemSize,LastLogonTime | format-table DisplayName, @{expression={$_.TotalItemSize.Value.ToMB()};label=”TotalItemSize(MB)”}, LastLogonTime, DatabaseName
(This will give you info on the selected users mailbox size, last login time and database)
you could use:
Get-MailboxStatistics –id “User name” |fl displayname,totalitemsize
Message Trackign log:
Get-MessageTrackingLog -Start "04/13/2009 9:00AM" -End "04/26/2009 5:00PM" -Sender "jamesluo@sg.com" | Select-Object Timestamp,Sender, {$_.recipients}, MessageSubject | export-csv c:\QueryAllRecipients.csv
Add full mailbox permission:
Add-MailboxPermission -Identity 'CN=Journal Technical,OU=Technical,DC=EGRP,DC=local' -User 'EGRP\Domain Admins' -AccessRights 'FullAccess'
How To Check Exchange Database Size with PowerShell
Get-MailboxDatabase -Status | select ServerName,Name,DatabaseSize
Edge Sync
Start-EdgeSynchronization -Server Hub1
Calendar Permissions:
add-MailboxFolderPermission -Identity DarrenBos:\calendar -AccessRights Editor -User Scotteastman
Which Servers are people logged onto
Get-LogonStatistics -Identity "seastman" |fl clientname
Message Tracking
Get-Exchangeserver | where {$_.isHubTransportServer -eq $true -or $_.isMailboxServer -eq $true} | Get-Messagetrackinglog -sender user@domain.com -MessageSubject "Subject of message” -Start "8/27/2010 7:00 AM" -End "8/27/2010 11:00 AM" | Select-Object Timestamp,Clienthostname,eventid,source,sender,@{Name="Recipients";Expression={$_.recipients}},Recipientcount,serverhostname,SourceContext | Export-Csv c:\temp\Messageinfo.csv
Search mailbox - then put results into my mailbox in folder called XEN:
Search-Mailbox -Identity zwood -SearchQuery "From:'cs@enta.net'" -TargetMailbox seastman -TargetFolder "XEN" -LogLevel Full
Removing Emails from all mailbox's
Get-Mailbox -database "ENTA IT" -resultsize unlimited | Search-Mailbox -SearchQuery "From:'*@*.acidkrew.com'" -DeleteContent
Get-Mailbox -resultsize unlimited | Search-Mailbox -SearchQuery "From:'xraytechnician.ekcgen@aqveii.acidkrew.com'" -DeleteContent
Get-Mailbox -resultsize unlimited | Search-Mailbox -SearchQuery "From:'User X' To:'All Email Users'" -DeleteContent
Get-Mailbox -resultsize unlimited | Search-Mailbox -SearchQuery "Subject: Update Your E-Mail Details Account" -DeleteContent
Tracking Emails
get-messagetrackinglog -Server "ourExch2007" -Start "10/25/2009 9:34:00 AM" -End "11/6/2009 9:44:00 AM" -resultsize unlimited |where {$_.Sender -like "*@domain.com"}
Wondering how many log files are generated per database every minute? Quickly find out by typing:
Get-MailboxDatabase -Server $env:ComputerName | %{ Get-ChildItem -Path $_.LogFolderPath -Filter "*????.log" | Group-Object -Property {$_.LastWriteTime.Day,$_.LastWriteTime.Hour,$_.LastWriteTime.minute} | ?{$_.Count -gt 1} | Measure-Object - Property Count -Min -Max -Ave }
Mailbox Size
Get-MailboxStatistics -server exchangemb11 | Sort-Object TotalItemSize -Descending | ft Display
Name,@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},ItemCount | Format-List > c:\file.txt
Export Mailbox Request
New-MailboxExportRequest -Mailbox journal1 -FilePath "\\vmmlibrary\Exchange_Backup\Journal Backup\Master Journal\Journal1.pst"
Get-MailboxStatistics –id “User name” |fl displayname,totalitemsize
Message Trackign log:
Get-MessageTrackingLog -Start "04/13/2009 9:00AM" -End "04/26/2009 5:00PM" -Sender "jamesluo@sg.com" | Select-Object Timestamp,Sender, {$_.recipients}, MessageSubject | export-csv c:\QueryAllRecipients.csv
Add full mailbox permission:
Add-MailboxPermission -Identity 'CN=Journal Technical,OU=Technical,DC=EGRP,DC=local' -User 'EGRP\Domain Admins' -AccessRights 'FullAccess'
How To Check Exchange Database Size with PowerShell
Get-MailboxDatabase -Status | select ServerName,Name,DatabaseSize
Edge Sync
Start-EdgeSynchronization -Server Hub1
Calendar Permissions:
add-MailboxFolderPermission -Identity DarrenBos:\calendar -AccessRights Editor -User Scotteastman
Which Servers are people logged onto
Get-LogonStatistics -Identity "seastman" |fl clientname
Message Tracking
Get-Exchangeserver | where {$_.isHubTransportServer -eq $true -or $_.isMailboxServer -eq $true} | Get-Messagetrackinglog -sender user@domain.com -MessageSubject "Subject of message” -Start "8/27/2010 7:00 AM" -End "8/27/2010 11:00 AM" | Select-Object Timestamp,Clienthostname,eventid,source,sender,@{Name="Recipients";Expression={$_.recipients}},Recipientcount,serverhostname,SourceContext | Export-Csv c:\temp\Messageinfo.csv
Search mailbox - then put results into my mailbox in folder called XEN:
Search-Mailbox -Identity zwood -SearchQuery "From:'cs@enta.net'" -TargetMailbox seastman -TargetFolder "XEN" -LogLevel Full
Removing Emails from all mailbox's
Get-Mailbox -database "ENTA IT" -resultsize unlimited | Search-Mailbox -SearchQuery "From:'*@*.acidkrew.com'" -DeleteContent
Get-Mailbox -resultsize unlimited | Search-Mailbox -SearchQuery "From:'xraytechnician.ekcgen@aqveii.acidkrew.com'" -DeleteContent
Get-Mailbox -resultsize unlimited | Search-Mailbox -SearchQuery "From:'User X' To:'All Email Users'" -DeleteContent
Get-Mailbox -resultsize unlimited | Search-Mailbox -SearchQuery "Subject: Update Your E-Mail Details Account" -DeleteContent
Tracking Emails
get-messagetrackinglog -Server "ourExch2007" -Start "10/25/2009 9:34:00 AM" -End "11/6/2009 9:44:00 AM" -resultsize unlimited |where {$_.Sender -like "*@domain.com"}
Wondering how many log files are generated per database every minute? Quickly find out by typing:
Get-MailboxDatabase -Server $env:ComputerName | %{ Get-ChildItem -Path $_.LogFolderPath -Filter "*????.log" | Group-Object -Property {$_.LastWriteTime.Day,$_.LastWriteTime.Hour,$_.LastWriteTime.minute} | ?{$_.Count -gt 1} | Measure-Object - Property Count -Min -Max -Ave }
Mailbox Size
Get-MailboxStatistics -server exchangemb11 | Sort-Object TotalItemSize -Descending | ft Display
Name,@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},ItemCount | Format-List > c:\file.txt
Export Mailbox Request
New-MailboxExportRequest -Mailbox journal1 -FilePath "\\vmmlibrary\Exchange_Backup\Journal Backup\Master Journal\Journal1.pst"
get-messagetrackinglog -Sender "Jim.Woods@entagroup.com" |
Select-Object Timestamp,Sender, {$_.recipients}, MessageSubject | export-csv
'V:\IT\Exchange\LOGS\Jim Woods\jimEdge.csv'
Use the Shell to remove a
mailbox export request:
Remove-MailboxExportRequest -Identity "Ayla\MailboxExport"
Use the Shell to remove multiple mailbox export requests:
Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest
Remove-MailboxExportRequest -Identity "Ayla\MailboxExport"
Use the Shell to remove multiple mailbox export requests:
Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest
Archiving Info:
Get-Mailbox | where {$_.ArchiveDatabase -ne $null}
Get-Mailbox | where {$_.ArchiveDatabase -ne $null} | ft name, archivedatabase, archivename, archivequota, archivewarningquota -AutoSize
Find a users Archive information:
get-mailboxstatistics mailboxname –archive
Get-Mailbox -archive | Get-MailboxStatistics -archive |fl DisplayName, Total*
Get-Mailbox | where {$_.ArchiveDatabase -ne $null}
Get-Mailbox | where {$_.ArchiveDatabase -ne $null} | ft name, archivedatabase, archivename, archivequota, archivewarningquota -AutoSize
Find a users Archive information:
get-mailboxstatistics mailboxname –archive
Get-Mailbox -archive | Get-MailboxStatistics -archive |fl DisplayName, Total*
Export Tracking Logs to
CSV
Export-MessageTrackingLogsForRecipient.ps1 -Recipient steve -OutputCSV .\output.csv
Export-MessageTrackingLogsForRecipient.ps1 -Recipient steve -OutputCSV .\output.csv
Mailbox Size Report:
get-mailbox | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft DisplayName,@{
label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},@{label="TotalItemSize(GB)";expression={$_.TotalItemSize.Value.ToGB()}} >c:\scott4.xls
Database size report:
Get-MailboxDatabase -status | Sort-Object databaseSize -Descending |ft name,databasesize
get-mailbox | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft DisplayName,@{
label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},@{label="TotalItemSize(GB)";expression={$_.TotalItemSize.Value.ToGB()}} >c:\scott4.xls
Database size report:
Get-MailboxDatabase -status | Sort-Object databaseSize -Descending |ft name,databasesize
Get Managed Folder
Assistant
Get-MailboxServer | fl Name,ManagedFolderAssistantSchedule
Get Mailbox Database Copy Status
Get-mailboxdatabasecopystatus -connectionstatus | fl name,outgoingconnections,incominglogcopyingnetwork
Add Domain Admins FULL access rights to every mailbox
Get-MailboxDatabase | Add-ADPermission -user "Domain Admins" -AccessRights GenericAll
Get-MailboxServer | fl Name,ManagedFolderAssistantSchedule
Get Mailbox Database Copy Status
Get-mailboxdatabasecopystatus -connectionstatus | fl name,outgoingconnections,incominglogcopyingnetwork
Add Domain Admins FULL access rights to every mailbox
Get-MailboxDatabase | Add-ADPermission -user "Domain Admins" -AccessRights GenericAll
Enable Pipeline
Tracing
Set-TransportServer -id Exchangemb11 -PipelineTracingEnabled $true -PipelineTracingSenderAddress news@entagroup.com -PipelineTracingPath "C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\Logs\PipelineTracing"
First turn it on: Set-TransportServer Server1 -PipelineTracingEnabled $True
This will create a folder called PipelineTracing and all the email messages and info will be in there
Mailbox Permission Change:
Add-MailboxPermission -Identity 'CN=Journal Master4,OU=IT,DC=EGRP,DC=local' -User 'EGRP\Domain Admins' -AccessRights 'FullAccess'
Set-TransportServer -id Exchangemb11 -PipelineTracingEnabled $true -PipelineTracingSenderAddress news@entagroup.com -PipelineTracingPath "C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\Logs\PipelineTracing"
First turn it on: Set-TransportServer Server1 -PipelineTracingEnabled $True
This will create a folder called PipelineTracing and all the email messages and info will be in there
Mailbox Permission Change:
Add-MailboxPermission -Identity 'CN=Journal Master4,OU=IT,DC=EGRP,DC=local' -User 'EGRP\Domain Admins' -AccessRights 'FullAccess'
AD Get-ADUser DisplayName Disable-ADAccount
Get-ADUser -Filter {DisplayName -like "123456(陳XX)"} | Disable-ADAccount -Confirm:$false
2013年12月22日 星期日
2013年9月12日 星期四
VMM Performing an operation in Virtual Machine Manager fails with error 801
VMM Performing an operation in Virtual Machine Manager fails with error 801
To resolve this issue, remove the orphaned objects from the database by following the steps below.
1. Stop the System Center Virtual Machine Manager service on the VMM 2012 server.
2. Back up the Virtual Manager database.
3. Open SQL Management Studio and run the following script on the VMM database:
4. Start the System Center Virtual Machine Manager service again and refresh problem VMs. The VMs should return to a proper reporting state.
To resolve this issue, remove the orphaned objects from the database by following the steps below.
1. Stop the System Center Virtual Machine Manager service on the VMM 2012 server.
2. Back up the Virtual Manager database.
3. Open SQL Management Studio and run the following script on the VMM database:
BEGIN TRANSACTION T1
DECLARE custom_cursor CURSOR FOR
SELECT VHDId, VDriveId from
dbo.tbl_WLC_VDrive WHERE [VHDId] NOT IN
(SELECT VHDId from dbo.tbl_WLC_VHD WHERE VHDID IS NOT NULL)
DECLARE @VHDId uniqueidentifier
DECLARE @VDriveId uniqueidentifier
OPEN custom_cursor
FETCH NEXT FROM custom_cursor INTO @VHDId, @VDriveId
WHILE(@@fetch_status = 0)
BEGIN
if(@VHDId is NOT NULL)
DELETE FROM dbo.tbl_WLC_VDrive
WHERE VDriveId = @VDriveId
FETCH NEXT FROM custom_cursor INTO @VHDId, @VDriveId
END
CLOSE custom_cursor
DEALLOCATE custom_cursor
COMMIT TRANSACTION T1
2013年9月6日 星期五
Exchange 刪除公用資料夾使用ADSI
Exchange 刪除公用資料夾使用ADSI
1. Open Adsiedit.msc from run command
2. Navigate to your configuration container 3. Expand to services, Microsoft Exchange, your org name, admin groups, servers, locate your FE server, expand, Expand information store, and storage group that houses your public folder store. On the right pane, delete the public folder store.
1. Open Adsiedit.msc from run command
2. Navigate to your configuration container 3. Expand to services, Microsoft Exchange, your org name, admin groups, servers, locate your FE server, expand, Expand information store, and storage group that houses your public folder store. On the right pane, delete the public folder store.
Exchange New-OfflineAddressBook
New-OfflineAddressBook -Name "OAL-MAIL15" -AddressLists "\Default Global Address List" -Server cch-mail15 -VirtualDirectories "CCH-MAIL02\OAB (Default Web Site)","CCH-MAIL03\OAB (Default Web Site)","CCH-MAIL06\OAB (Default Web Site)","CCH-MAIL07\OAB (Default Web Site)"
2013年9月4日 星期三
Exchange 移除狀態為已完成的所有匯出要求。MailboxExportRequest
移除狀態為已完成的所有匯出要求。
Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest
Exchange 取得狀態為Softdeleted的信箱
Exchange 取得狀態為Softdeleted的信箱,不曉得幹馬用的
Get-MailboxStatistics -Database xxx| Where-Object {$_.DisconnectReason -eq “Softdeleted”} | ForEach {Remove-StoreMailbox -Database $_.database -identity $_.mailboxguid -MailboxState Softdeleted}
Get-MailboxStatistics -Database xxx| Where-Object {$_.DisconnectReason -eq “Softdeleted”} | ForEach {Remove-StoreMailbox -Database $_.database -identity $_.mailboxguid -MailboxState Softdeleted}
2013年9月2日 星期一
Proxy IE登錄匯入
Proxy IE登錄匯入
ProxyDisable
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections]
"DefaultConnectionSettings"=hex:46,00,00,00,00,11,00,00,01,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,b2,8f,50,49,f6,3b,cc,01,\
00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,02,00,00,00,c0,a8,02,53,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
SetProxy
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="172.28.27.247:8080"
"ProxyOverride"="<local>"
ProxyDisable
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections]
"DefaultConnectionSettings"=hex:46,00,00,00,00,11,00,00,01,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,b2,8f,50,49,f6,3b,cc,01,\
00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,00,02,00,00,00,c0,a8,02,53,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
SetProxy
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="172.28.27.247:8080"
"ProxyOverride"="<local>"
Exchange Get-PublicFolder 取得系統資料夾Replicas的狀態並匯出
Get-PublicFolder 取得系統資料夾Replicas的狀態並匯出
Get-PublicFolderStatistics -Server cch-mail13
Get-PublicFolder -Identity \NON_IPM_SUBTREE -Recurse | fl Name,Replicas > c:\pf-system-replicas.txt
CD\Program Files\Microsoft\Exchange Server\V14\Scripts
Get-PublicFolder -Identity \IPM_SUBTREE -Recurse –Server cch-mail11 | fl Name,Replicas > c:\pf-system-replicas.txt
Get-PublicFolder -Identity \NON_IPM_SUBTREE -Recurse | fl Na
me,Replicas > c:\pf-system-replicas.txt
Get-PublicFolder -Identity \ -Recurse | fl Name,Replicas > c:\pf-system-replicas.txt
可以看出那些項目未移除複本
--------------------------------------------------------
Microsoft Exchange 錯誤
--------------------------------------------------------
無法刪除公用資料夾資料庫 'PUBLIC13'。
PUBLIC13
失敗
錯誤:
公用資料夾資料庫 "PUBLIC13" 包含資料夾複本。刪除公用資料夾資料庫前,請先移除資料夾或將複本移至其他公用資料夾資料庫。如需如何移除公用資料夾資料庫的詳細指示,請參閱 http://go.microsoft.com/fwlink/?linkid=81409&clcid=0x404。
--------------------------------------------------------
確定
--------------------------------------------------------
Get-PublicFolderStatistics -Server cch-mail13
Get-PublicFolder -Identity \NON_IPM_SUBTREE -Recurse | fl Name,Replicas > c:\pf-system-replicas.txt
CD\Program Files\Microsoft\Exchange Server\V14\Scripts
Get-PublicFolder -Identity \IPM_SUBTREE -Recurse –Server cch-mail11 | fl Name,Replicas > c:\pf-system-replicas.txt
Get-PublicFolder -Identity \NON_IPM_SUBTREE -Recurse | fl Na
me,Replicas > c:\pf-system-replicas.txt
Get-PublicFolder -Identity \ -Recurse | fl Name,Replicas > c:\pf-system-replicas.txt
可以看出那些項目未移除複本
--------------------------------------------------------
Microsoft Exchange 錯誤
--------------------------------------------------------
無法刪除公用資料夾資料庫 'PUBLIC13'。
PUBLIC13
失敗
錯誤:
公用資料夾資料庫 "PUBLIC13" 包含資料夾複本。刪除公用資料夾資料庫前,請先移除資料夾或將複本移至其他公用資料夾資料庫。如需如何移除公用資料夾資料庫的詳細指示,請參閱 http://go.microsoft.com/fwlink/?linkid=81409&clcid=0x404。
--------------------------------------------------------
確定
--------------------------------------------------------
2013年8月31日 星期六
Exchange 有公用資料夾移動到另一部伺服器的公用資料夾資料庫 ReplaceReplicaOnPFRecursive.ps1
.\AddReplicaToPFRecursive.ps1 -server "CCH-MAIL11" -TopPublicFolder "\" -ServerToAdd "CCH-MAIL16"
.\AddReplicaToPFRecursive.ps1 -server "CCH-MAIL13" -TopPublicFolder "\NON_IPM_SUBTREE" -ServerToAdd "CCH-MAIL15"
幹REMOVE時 -TopPublicFolder \ 不用""包
.\RemoveReplicaToPFRecursive.ps1 -server "CCH-MAIL15" -TopPublicFolder \ -ServerToRemove "CCH-MAIL11"
AddReplicaToPFRecursive.ps1
[-Server <ServerIdParameter>]
[-TopPublicFolder <PublicFolderIdParameter>]
[-ServerToAdd <ServerIdParameter>]
PARAMETERS:
-Server (optional)
The server to operate against. Must be an Exchange 2007 Mailbox server
with a public folder database. Defaults to a convenient server.
-TopPublicFolder (required)
The folder identity of the top of the tree of folders to modify
-ServerToAdd (required)
The server identity to add to the replica list. Must be a server with a
public folder database.
-------------------------- EXAMPLE 1 --------------------------
C:\PS> .\AddReplicaToPFRecursive.ps1 -TopPublicFolder "\Folder" -ServerToAdd "MyEx2003Server"
-------------------------- EXAMPLE 2 --------------------------
C:\PS> .\AddReplicaToPFRecursive.ps1 -Server "MyEx2007Server" -TopPublicFolder "\Folder" -ServerToAdd "MyEx2003Server"
.\AddReplicaToPFRecursive.ps1 -TopPublicFolder "\NON_IPM_Subtree" -ServerToAdd "CCH-MAIL16"
2013年8月29日 星期四
Exchange 仲裁信箱 Arbitration Mailbox
Get-Mailbox -Database <Database ID> -Arbitration
New-MoveRequest -Identity "SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}" -TargetDatabase "17E"
New-MoveRequest -Identity "SystemMailbox{1f05a927-58e1-439d-ac15-f69c0d044383}" -TargetDatabase "17E"
New-MoveRequest -Identity "FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042" -TargetDatabase "17E"
get-mailbox -Identity "FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042" | fd -wrap
FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042
1. Find the Arbitration Mailbox using the Exchange MAnagement Shell (EMS):
Get-Mailbox -Arbitration | Where {$_.Name -like "SystemMailbox*" } | ft –wrap
2. Now create a new move request in order to move the system mailboxes to another mailbox database:
New-MoveRequest -Identity "SystemMailbox{1f05a927-32d1-4e19-8ea5-67eba859f541-yourGUID}" -TargetDatabase "dbxxxx"
3. Verify whether the move request completed:
Get-MoveRequest
4. Now remove the move request
Remove-MoveRequest -Identity "the name of the request like Microsoft Exchange Approval Assistant"
Exchange determine the Microsoft Exchange version
Get-ExchangeServer | Format-Table Name, *Version*
Microsoft Exchange
2010
To determine the Rollup that has been
applied to Microsoft Exchange 2010, run the following command in the
Exchange Management Shell:
GCM exsetup
|%{$_.Fileversioninfo}
To determine the Microsoft Exchange
version for all Microsoft Exchange Servers in the organisation:
Get-ExchangeServer | Format-Table Name, *Version*
Exchange 無法在移動後清理來源信箱.
此方法無效
警告: 無法在移動後清理來源信箱.
錯誤詳細資料: MapiExceptionUnexpectedMailboxState: Unable to delete mailbox. (hr=0x80004005, ec=2634)
To Speed up the move request:
On ALL CAS Servers
Edit C:\Program Files\Microsoft\Exchange Server\V14\Bin\MSExchangeMailboxReplication.exe.config
--Find the following counter: “maxCleanupRetries”
--The default value is 5. Change to 1.
Restart MSExchangeMailboxReplication Service
To Clean up a Soft Deleted Mailbox on a database:
Get-MailboxStatistics -Database <MAILBOXDATABASE> | Where { $_.DisconnectReason -eq "SoftDeleted" } | Format-List LegacyDN, DisplayName, MailboxGUID, DisconnectReason
Remove-StoreMailbox -Database <MAILBOXDATABASE> -Identity <MAILBOXGUID> -MailboxState Softdeleted
To Clean up all Soft Deleted Mailboxes on a database:
Get-MailboxStatistics -Database <MAILBOXDATABASE> | Where-Object {$_.DisconnectReason -eq “Softdeleted”} | ForEach {Remove-StoreMailbox -Database $_.database -identity $_.mailboxguid -MailboxState Softdeleted}
Remove-StoreMailbox -Database db_name -Identity "User name" -MailboxState Softdeleted
警告: 無法在移動後清理來源信箱.
錯誤詳細資料: MapiExceptionUnexpectedMailboxState: Unable to delete mailbox. (hr=0x80004005, ec=2634)
To Speed up the move request:
On ALL CAS Servers
Edit C:\Program Files\Microsoft\Exchange Server\V14\Bin\MSExchangeMailboxReplication.exe.config
--Find the following counter: “maxCleanupRetries”
--The default value is 5. Change to 1.
Restart MSExchangeMailboxReplication Service
To Clean up a Soft Deleted Mailbox on a database:
Get-MailboxStatistics -Database <MAILBOXDATABASE> | Where { $_.DisconnectReason -eq "SoftDeleted" } | Format-List LegacyDN, DisplayName, MailboxGUID, DisconnectReason
Remove-StoreMailbox -Database <MAILBOXDATABASE> -Identity <MAILBOXGUID> -MailboxState Softdeleted
To Clean up all Soft Deleted Mailboxes on a database:
Get-MailboxStatistics -Database <MAILBOXDATABASE> | Where-Object {$_.DisconnectReason -eq “Softdeleted”} | ForEach {Remove-StoreMailbox -Database $_.database -identity $_.mailboxguid -MailboxState Softdeleted}
Remove-StoreMailbox -Database db_name -Identity "User name" -MailboxState Softdeleted
Exchange Create a Mailbox Repair Request
FIX ALL
New-MailboxRepairRequest -Mailbox 9000 -CorruptionType SearchFolder,AggregateCounts,ProvisionedFolder,FolderView
New-MailboxRepairRequest -Mailbox tony@contoso.com -CorruptionType FolderView
Get-Mailbox -Filter {CustomAttribute2 -like "Repair Required"} | New-MailboxRepairRequest -CorruptionType SearchFolder,AggregateCounts,ProvisionedFolder,FolderView
New-MailboxRepairRequest -Mailbox ayla -CorruptionType ProvisionedFolder,SearchFolder -DetectOnly
New-MailboxRepairRequest -Mailbox ayla -CorruptionType ProvisionedFolder,SearchFolder -DetectOnly
New-MailboxRepairRequest -Database MBX-DB01 -CorruptionType AggregateCounts
2013年8月28日 星期三
2013年8月27日 星期二
Exchange Remove-DatabaseAvailabilityGroupServer Uninstall Exchange2010
Remove-DatabaseAvailabilityGroupServer
摘要: 1 個項目。1 個成功,0 個失敗。
經過時間: 00:01:43
CCH-MAIL19
已完成
警告:
Active Manager 作業失敗。錯誤 嘗試叢集作業時發生錯誤。錯誤: 收回節點 'cch-mail19' 已返回,但並未完全清除該節點。請執行 cluster.exe node <NodeName> /forcecleanup 以完成清除此節點的作業。。
已完成的 Exchange 管理命令介面命令:
Remove-DatabaseAvailabilityGroupServer -MailboxServer 'CCH-MAIL19' -Identity 'DAG16'
經過時間: 00:01:43
Uninstall Exchange2010
摘要: 2 個項目。1 個成功,1 個失敗。
經過時間: 00:00:10
正在設定必要條件
已完成
經過時間: 00:00:00
信箱角色 必要條件
失敗
錯誤:
此電腦是叢集成員,必須先使用 Remove-DatabaseAvailabilityGroupServer 工作將它從資料庫可用性群組移除,才能解除安裝 Exchange。
按一下這裡以取得說明... http://go.microsoft.com/fwlink/?linkid=30939&l=zh-Hant&v=ExBPA.14&id=22cdcab6-17f3-435a-a3a9-ec7dcb636608
經過時間: 00:00:10
cluster.exe node <NodeName> /forcecleanup 這個在Server2012上打到死都不能RUN
要用POWERSHELL http://technet.microsoft.com/zh-tw/library/ee619744(v=ws.10).aspx
cluster node /forcecleanup | Clear-ClusterNode For more information, see: Clear-ClusterNode (http://go.microsoft.com/fwlink/?LinkId=143781) |
2013年8月26日 星期一
VMM Performing an operation in Virtual Machine Manager fails with error 801
VMM cannot find the Virtual hard disk object' error 801
To resolve this issue, remove the orphaned objects from the database by following the steps below.
1. Stop the System Center Virtual Machine Manager service on the VMM 2012 server.
2. Back up the Virtual Manager database.
3. Open SQL Management Studio and run the following script on the VMM database:
4. Start the System Center Virtual Machine Manager service again and refresh problem VMs. The VMs should return to a proper reporting state.
To resolve this issue, remove the orphaned objects from the database by following the steps below.
1. Stop the System Center Virtual Machine Manager service on the VMM 2012 server.
2. Back up the Virtual Manager database.
3. Open SQL Management Studio and run the following script on the VMM database:
BEGIN TRANSACTION T1
DECLARE custom_cursor CURSOR FOR
SELECT VHDId, VDriveId from
dbo.tbl_WLC_VDrive WHERE [VHDId] NOT IN
(SELECT VHDId from dbo.tbl_WLC_VHD WHERE VHDID IS NOT NULL)
DECLARE @VHDId uniqueidentifier
DECLARE @VDriveId uniqueidentifier
OPEN custom_cursor
FETCH NEXT FROM custom_cursor INTO @VHDId, @VDriveId
WHILE(@@fetch_status = 0)
BEGIN
if(@VHDId is NOT NULL)
DELETE FROM dbo.tbl_WLC_VDrive
WHERE VDriveId = @VDriveId
FETCH NEXT FROM custom_cursor INTO @VHDId, @VDriveId
END
CLOSE custom_cursor
DEALLOCATE custom_cursor
COMMIT TRANSACTION T1
2013年8月25日 星期日
AD 依條件搬移ADComputer物件到指定的容器中
AD 依條件搬移ADComputer物件到指定的容器中
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe Move-ADObject.ps1
Move-ADObject.ps1
Import-Module activedirectory
$target = Get-ADOrganizationalUnit -LDAPFilter "(name=用戶端電腦)"
Get-ADComputer -LDAPFilter "(name=CAR*)" -SearchBase "CN=Computers,DC=cch,DC=org,DC=tw" | Move-ADObject -TargetPath $target.DistinguishedName
Get-ADComputer -LDAPFilter "(name=PCS*)" -SearchBase "CN=Computers,DC=cch,DC=org,DC=tw" | Move-ADObject -TargetPath $target.DistinguishedName
Get-ADComputer -LDAPFilter "(name=OA*)" -SearchBase "CN=Computers,DC=cch,DC=org,DC=tw" | Move-ADObject -TargetPath $target.DistinguishedName
Get-ADComputer -LDAPFilter "(name=IPD*)" -SearchBase "CN=Computers,DC=cch,DC=org,DC=tw" | Move-ADObject -TargetPath $target.DistinguishedName
Get-ADComputer -LDAPFilter "(name=OPD*)" -SearchBase "CN=Computers,DC=cch,DC=org,DC=tw" | Move-ADObject -TargetPath $target.DistinguishedName
Get-ADComputer -LDAPFilter "(name=CR*)" -SearchBase "CN=Computers,DC=cch,DC=org,DC=tw" | Move-ADObject -TargetPath $target.DistinguishedName
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe Move-ADObject.ps1
Move-ADObject.ps1
Import-Module activedirectory
$target = Get-ADOrganizationalUnit -LDAPFilter "(name=用戶端電腦)"
Get-ADComputer -LDAPFilter "(name=CAR*)" -SearchBase "CN=Computers,DC=cch,DC=org,DC=tw" | Move-ADObject -TargetPath $target.DistinguishedName
Get-ADComputer -LDAPFilter "(name=PCS*)" -SearchBase "CN=Computers,DC=cch,DC=org,DC=tw" | Move-ADObject -TargetPath $target.DistinguishedName
Get-ADComputer -LDAPFilter "(name=OA*)" -SearchBase "CN=Computers,DC=cch,DC=org,DC=tw" | Move-ADObject -TargetPath $target.DistinguishedName
Get-ADComputer -LDAPFilter "(name=IPD*)" -SearchBase "CN=Computers,DC=cch,DC=org,DC=tw" | Move-ADObject -TargetPath $target.DistinguishedName
Get-ADComputer -LDAPFilter "(name=OPD*)" -SearchBase "CN=Computers,DC=cch,DC=org,DC=tw" | Move-ADObject -TargetPath $target.DistinguishedName
Get-ADComputer -LDAPFilter "(name=CR*)" -SearchBase "CN=Computers,DC=cch,DC=org,DC=tw" | Move-ADObject -TargetPath $target.DistinguishedName
Exchange 更新所有的通訊清單及郵件政策
Exchange 更新所有的通訊清單及郵件政策
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe\update-address.ps1
update-address.ps1
add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010
Get-AddressList | Update-AddressList
Get-GlobalAddressList | Update-GlobalAddressList
Get-OfflineAddressBook | Update-OfflineAddressBook
Get-EmailAddressPolicy | Update-EmailAddressPolicy
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe\update-address.ps1
update-address.ps1
add-pssnapin Microsoft.Exchange.Management.PowerShell.E2010
Get-AddressList | Update-AddressList
Get-GlobalAddressList | Update-GlobalAddressList
Get-OfflineAddressBook | Update-OfflineAddressBook
Get-EmailAddressPolicy | Update-EmailAddressPolicy
Exchange 備份信箱至PST
Exchange 備份信箱至PST
New-MailboxExportRequest -Mailbox jmail -FilePath "E:\jmail.pst"
New-MailboxExportRequest -Mailbox jmail -FilePath "E:\jmail.pst"
Exchange 取得物件LastLoggedOnUserAccount=XXX的信箱
Exchange 取得物件LastLoggedOnUserAccount=XXX的信箱
get-mailbox | get-mailboxstatistics | where-object {$_.LastLoggedOnUserAccount -eq "cch\XXX"}
get-mailbox | get-mailboxstatistics | where-object {$_.LastLoggedOnUserAccount -eq "cch\XXX"}
Exchange Add-MailboxPermission Remove-MailboxPermission
Exchange Add-MailboxPermission Remove-MailboxPermission
Add-MailboxPermission -Identity 'CN=12345,OU=其他,DC=cch,DC=org,DC=tw' -User 'CCH\67890' -AccessRights 'FullAccess'
Remove-MailboxPermission -Identity 'CN=12345,OU=總院,DC=cch,DC=org,DC=tw' -User 'CCH\67890' -InheritanceType 'All' -AccessRights 'FullAccess'
Add-MailboxPermission -Identity 'CN=12345,OU=其他,DC=cch,DC=org,DC=tw' -User 'CCH\67890' -AccessRights 'FullAccess'
Remove-MailboxPermission -Identity 'CN=12345,OU=總院,DC=cch,DC=org,DC=tw' -User 'CCH\67890' -InheritanceType 'All' -AccessRights 'FullAccess'
Exchange 取得超過一年未登入的信箱
Exchange 取得超過一年未登入的信箱
Get-Mailbox -Server xxx -ResultSize Unlimited | Get-MailboxStatistics | where {$_.Lastlogontime -lt (get-date).AddDays(-365)} | Select DisplayName, LastLogonTime,StorageLimitStatus | Export-CSV -Encoding Unicode "C:\LastLogonTime365.txt" -NoTypeInformation
Get-Mailbox -Server xxx -ResultSize Unlimited | Get-MailboxStatistics | where {$_.Lastlogontime -lt (get-date).AddDays(-365)} | Select DisplayName, LastLogonTime,StorageLimitStatus | Export-CSV -Encoding Unicode "C:\LastLogonTime365.txt" -NoTypeInformation
Exchange 取得SERVER中信箱已滿Mailbox Disabled的使用者並匯出
Exchange 取得SERVER中信箱已滿Mailbox Disabled的使用者並匯出
Get-Mailbox -Server xxxx -ResultSize Unlimited | Get-MailboxStatistics | where {$_.StorageLimitStatus -match "MailboxDisabled"} | Select DisplayName, LastLogonTime,StorageLimitStatus | Export-CSV -Encoding Unicode "C:\temp\MailboxDisabled.txt" -NoTypeInformation
StorageLimitStatus -ne 不等於???
StorageLimitStatus -eq 等於
Exchange 取得信箱大小排序並匯出
Exchange 取得信箱大小排序並匯出
Get-Mailbox -Server xxxx -ResultSize Unlimited | Get-MailboxStatistics | where {$_.StorageLimitStatus -ne "BelowLimit"} | Select DisplayName,LastLoggedOnUserAccount,StorageLimitStatus,@{name="TotalItemSize (MB)";expression={[math]::Round(($_.TotalItemSize.Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},@{name="TotalDeletedItemSize (MB)";expression={[math]::Round(($_.TotalDeletedItemSize.Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},ItemCount,DeletedItemCount | Sort "TotalItemSize (MB)" -Descending | Export-CSV -Encoding Unicode "C:\TEST\Exceeded Quotas.csv" -NoTypeInformation
Get-Mailbox -Server xxxx -ResultSize Unlimited | Get-MailboxStatistics | where {$_.StorageLimitStatus -ne "BelowLimit"} | Select DisplayName,LastLoggedOnUserAccount,StorageLimitStatus,@{name="TotalItemSize (MB)";expression={[math]::Round(($_.TotalItemSize.Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},@{name="TotalDeletedItemSize (MB)";expression={[math]::Round(($_.TotalDeletedItemSize.Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},ItemCount,DeletedItemCount | Sort "TotalItemSize (MB)" -Descending | Export-CSV -Encoding Unicode "C:\TEST\Exceeded Quotas.csv" -NoTypeInformation
Exchange 取得DisplayName LastLogonTime StorageLimitStatus
Exchange 取得DisplayName LastLogonTime StorageLimitStatus
Get-Mailbox -Identity XXXXX -ResultSize Unlimited | Get-MailboxStatistics | Select DisplayName
, LastLogonTime,StorageLimitStatus
DisplayName LastLogonTime StorageLimitStatus
----------- ------------- ------------------
XXXXX(XXXX) BelowLimit
Get-Mailbox -Identity XXXXX -ResultSize Unlimited | Get-MailboxStatistics | Select DisplayName
, LastLogonTime,StorageLimitStatus
DisplayName LastLogonTime StorageLimitStatus
----------- ------------- ------------------
XXXXX(XXXX) BelowLimit
2013年8月24日 星期六
Exchange 查看使用者登入在那一個主機
Exchange 查看使用者登入在那一個主機
Which Servers are people logged onto
Get-LogonStatistics -Identity "DisplayName" |fl clientname
Get-LogonStatistics -Identity ID |fl clientname
Which Servers are people logged onto
Get-LogonStatistics -Identity "DisplayName" |fl clientname
Get-LogonStatistics -Identity ID |fl clientname
Exchange move-DatabasePath 搬移信箱資料庫路徑
Exchange move-DatabasePath 搬移信箱資料庫路徑
move-DatabasePath -Identity '14F' -EdbFilePath 'F:\Mailbox\14F\14F.edb' -LogFolderPath 'F:\Mailbox\Log\14F'
move-DatabasePath -Identity '14F' -EdbFilePath 'F:\Mailbox\14F\14F.edb' -LogFolderPath 'F:\Mailbox\Log\14F'
Exchange New-AddressList Move-AddressList 建立移動通訊清單
Exchange New-AddressList Move-AddressList 建立移動通訊清單
建立後移動
New-AddressList -Name "01.分院榮譽院長" -RecipientFilter {((RecipientType -eq 'UserMailbox') -a
nd ((CustomAttribute1 -like '分院榮譽院長') -or (CustomAttribute6 -like '分院榮譽院長') -or (CustomAttribute7 -like '分
院榮譽院長')))}
Move-AddressList -Identity 01.分院榮譽院長 -Target '\B.依主管職稱\A2.合作醫院與分院'
直接建立
New-AddressList -Name "\B.依主管職稱\A2.合作醫院與分院\01.分院榮譽院長" -RecipientFilter {((RecipientType -eq 'UserMailbox') -a
nd ((CustomAttribute1 -like '分院榮譽院長') -or (CustomAttribute6 -like '分院榮譽院長') -or (CustomAttribute7 -like '分
院榮譽院長')))}
移動
Move-AddressList -Identity "\C.總院\4.行政部門\體系營運中心\國際醫療中心" -Target "\C.總院\4.行政部門"
建立後移動
New-AddressList -Name "01.分院榮譽院長" -RecipientFilter {((RecipientType -eq 'UserMailbox') -a
nd ((CustomAttribute1 -like '分院榮譽院長') -or (CustomAttribute6 -like '分院榮譽院長') -or (CustomAttribute7 -like '分
院榮譽院長')))}
Move-AddressList -Identity 01.分院榮譽院長 -Target '\B.依主管職稱\A2.合作醫院與分院'
直接建立
New-AddressList -Name "\B.依主管職稱\A2.合作醫院與分院\01.分院榮譽院長" -RecipientFilter {((RecipientType -eq 'UserMailbox') -a
nd ((CustomAttribute1 -like '分院榮譽院長') -or (CustomAttribute6 -like '分院榮譽院長') -or (CustomAttribute7 -like '分
院榮譽院長')))}
移動
Move-AddressList -Identity "\C.總院\4.行政部門\體系營運中心\國際醫療中心" -Target "\C.總院\4.行政部門"
2013年8月23日 星期五
Exchange 匯出主機中所選的帳號資訊,並以最後登入時間排序‧
Exchange 匯出主機中所選的帳號資訊,並以最後登入時間排序‧
Get-Mailbox -server ServerName -ResultSize Unlimited | Get-MailboxStatistics | sort LastLogonTime | select DisplayName, LastLogonTime, LastLoggedOnUserAccount, TotalItemSize, DatabaseName, StorageLimitStatus | Out-File c:\temp\LastLogon_Report.csv
Get-Mailbox -server ServerName -ResultSize Unlimited | Get-MailboxStatistics | sort LastLogonTi
me | select DisplayName, LastLogonTime, LastLoggedOnUserAccount | Out-File c:\temp\LastLogon_Report.csv
Get-Mailbox -server ServerName -ResultSize Unlimited | Get-MailboxStatistics | sort LastLogonTime | select DisplayName, LastLogonTime, LastLoggedOnUserAccount, StorageLimitStatus | Out-File c:\temp\LastLogon_Report.csv
Get-Mailbox -server ServerName -ResultSize Unlimited | Get-MailboxStatistics | sort LastLogonTime | select DisplayName, LastLogonTime, LastLoggedOnUserAccount, TotalItemSize, DatabaseName, StorageLimitStatus | Out-File c:\temp\LastLogon_Report.csv
Get-Mailbox -server ServerName -ResultSize Unlimited | Get-MailboxStatistics | sort LastLogonTi
me | select DisplayName, LastLogonTime, LastLoggedOnUserAccount | Out-File c:\temp\LastLogon_Report.csv
Get-Mailbox -server ServerName -ResultSize Unlimited | Get-MailboxStatistics | sort LastLogonTime | select DisplayName, LastLogonTime, LastLoggedOnUserAccount, StorageLimitStatus | Out-File c:\temp\LastLogon_Report.csv
Exchange 清除信箱內所有信件
Exchange 清除信箱內所有信件
-Force 不提示執行
Search-Mailbox -Identity " DisplayName " -DeleteContent -Force
Search-Mailbox -Identity UserId -DeleteContent -Force
-Force 不提示執行
Search-Mailbox -Identity " DisplayName " -DeleteContent -Force
Search-Mailbox -Identity UserId -DeleteContent -Force
訂閱:
文章 (Atom)