First blog post

This is your very first post. Click the Edit link to modify or delete it, or start a new post. If you like, use this post to tell readers why you started this blog and what you plan to do with it.

Fremhevet innlegg

How to replace a drive in Storage Spaces

source: https://hodgkins.io/replace-failed-disk-in-storage-spaces-pool-with-powershell

 

 

# Find the failed Disk
Get-PhysicalDisk
# Shutdown, take the disk out and reboot. Set the missing disk to a variable
$missingDisk = Get-PhysicalDisk | WhereObject { $_.OperationalStatus -eq ‘Lost Communication’ }
# Retire the missing disk
$missingDisk | Set-PhysicalDisk Usage Retired
# Find the name of your new disk
Get-PhysicalDisk
# Set the replacement disk object to a variable
$replacementDisk = Get-PhysicalDisk –FriendlyName PhysicalDisk1
# Add replacement Disk to the Storage Pool
Add-PhysicalDisk –PhysicalDisks $replacementDisk –StoragePoolFriendlyName pool
# Repair each Volume
Repair-VirtualDisk –FriendlyName <VolumeName>
# Get the status of the rebuilds
Get-StorageJob
# Remove failed Virtual Disks
Remove-VirtualDisk –FriendlyName <FriendlyName>
# Remove the failed Physical Disk from the pool
Remove-PhysicalDisk –PhysicalDisks $missingDisk –StoragePoolFriendlyName pool

Use wmic to get details from your server

Here is a few line you can run at cmd.exe to get some information that you may use..

To get the serialnumber:

wmic bios get serialnumber

To get a model description:

wmic scproduct get name

To get the productnumber (SKU):

wmic /node:»server-name-here» /namespace:\rootwmi path MS_SystemInformation get SystemSKU

How to connect to Office 365 Exchange with powershell

 Fire up powershell

 

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session

To disconnect the session:

Remove-PSSession $Session

shared mailbox Office 365 – cannot expand folder both in OWA and Outlook

There is a bud in the GUI of Office 365 when delegating full permission to a user for shared mailbox.

Even if you give the correct permission you cannot expand the mailbox.

The fix is to remove and readd the permission with these powershell comamnds:

To Add

Add-MailboxPermission -Identity JDoe -User ‘testuser22’ -AccessRights FullAccess -InheritanceType All -AutoMapping $false

To Remove

Remove-MailboxPermission -Identity JDoe -User ‘testuser22’ -AccessRights FullAccess -InheritanceType All

How to remove system mailboxes and arbitration / federated mailboxes from last Exchange 2010 / 2013

This is just a plain copy paste for a note for myself.

please visit http://msexchangeguru.com/2013/01/02/exchange-2013-error/ which is the source for this paste

To resolve this, we need to move or disable the arbitration mailboxes on the server and remove the mailbox database manually.

You need to also ensure you do not have any user mailboxes in the database you are trying to get rid of.

Start Exchange Management Shell and type the command to display mailboxes in the whole forest and not just the domain you are logged into:

[PS] C:Windowssystem32>$AdminSessionADSettings.ViewEntireForest=$True

[PS] C:Windowssystem32>Get-MailboxDatabase -Server nbc-d-mbx02

Name Server Recovery ReplicationType

—- —— ——– —————

Database15         NBC-D-MBX02 False None

[PS] C:Windowssystem32>Get-MailboxDatabase “nbc-d-mbx02Database15” | Get-Mailbox

Now that you have the list of all mailboxes in the exchange database, move it to a different server

To work around the Arbitration mailbox issue, let’s find out the list of all Arbitration mailboxes

[PS] C:Windowssystem32>Get-Mailbox -Arbitration |ft Name, Servername

Name ServerName

—- ———-

SystemMailbox{1f05a927-0695-4348-bb62-d2369dcb23d5} nbc-d-mbx01

FederatedEmail.4c1f4d8b-8179-4148-93bf-00a95fa1e042 nbc-d-mbx01

SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9} nbc-d-mbx02

SystemMailbox{bb558c35-97f1-4cb9-8ff7-d53741dc928c} nbc-d-mbx02

Migration.8f3e7716-2011-43e4-96b1-aba62d229136 nbc-d-mbx02

Now will disable all of those since I do not have a different server to move them to.

[PS] C:Windowssystem32>Disable-Mailbox “SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}” -Arbitration -DisableLastArbitrationMailboxAllowed

Confirm

Are you sure you want to perform this action?

Disabling mailbox “SystemMailbox{e0dc1c29-89c3-4034-b678-e6c29d823ed9}” will remove the Exchange properties from the Active Directory user object and mark the mailbox in the database for removal. If the mailbox has an archive or remote archive, the archive will also be marked for removal. In the case of remote archives, this action is permanent. You can’t reconnect this user to the remote archive again.

[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is “Y”): a

[PS] C:Windowssystem32>Disable-Mailbox “SystemMailbox{bb558c35-97f1-4cb9-8ff7-d53741dc928c}” -Arbitration -DisableLastArbitrationMailboxAllowed

Confirm

Are you sure you want to perform this action?

Disabling mailbox “SystemMailbox{bb558c35-97f1-4cb9-8ff7-d53741dc928c}” will remove the Exchange properties from the Active Directory user object and mark the mailbox in the database for removal. If the mailbox has an archive or remote archive, the archive will also be marked for removal. In the case of remote archives, this action is permanent. You can’t reconnect this user to the remote archive again.

[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is “Y”): a

[PS] C:Windowssystem32>Disable-Mailbox “Migration.8f3e7716-2011-43e4-96b1-aba62d229136” -Arbitration -DisableLastArbitrationMailboxAllowed

Confirm

Are you sure you want to perform this action?

Disabling mailbox “Migration.8f3e7716-2011-43e4-96b1-aba62d229136” will remove the Exchange properties from the Active Directory user object and mark the mailbox in the database for removal. If the mailbox has an archive or remote archive, the archive will also be marked for removal. In the case of remote archives, this action is permanent. You can’t reconnect this user to the remote archive again.

[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is “Y”): a

[PS] C:Windowssystem32>Get-MailboxDatabase -Server nbc-d-mbx02

Name Server Recovery ReplicationType

—- —— ——– —————

Mailbox Database 0912423282 NBC-D-MBX02 False None

[PS] C:Windowssystem32>Remove-MailboxDatabase “Mailbox Database 0912423282”

Confirm

Are you sure you want to perform this action?

Removing mailbox database “Mailbox Database 0912423282”.

[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is “Y”): a

WARNING: The specified database has been removed. You must remove the database file located in E:Program FilesMicrosoftExchange ServerV15MailboxMailbox Database 0912423282Mailbox Database 0912423282.edb from your computer manually if it exists. Specified database: Mailbox Database 0912423282

Opprett en gratis blogg eller et nettsted på WordPress.com.

opp ↑