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)
 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-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
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*
Export Tracking Logs to 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 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
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'

NET disable firewall

netsh firewall set opmode mode=disable

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:

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
4. Start the System Center Virtual Machine Manager service again and refresh problem VMs. The VMs should return to a proper reporting state.

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.