SharePoint 2010 Version Number
(get-spfarm).buildversion
(get-spfarm).buildversion
# Script for creating a Role that can manage distributions groups but can't create new ones
#
#################################################################################
#
# The sample scripts are not supported under any Microsoft standard support
# program or service. The sample scripts are provided AS IS without warranty
# of any kind. Microsoft further disclaims all implied warranties including, without
# limitation, any implied warranties of merchantability or of fitness for a particular
# purpose. The entire risk arising out of the use or performance of the sample scripts
# and documentation remains with you. In no event shall Microsoft, its authors, or
# anyone else involved in the creation, production, or delivery of the scripts be liable
# for any damages whatsoever (including, without limitation, damages for loss of business
# profits, business interruption, loss of business information, or other pecuniary loss)
# arising out of the use of or inability to use the sample scripts or documentation,
# even if Microsoft has been advised of the possibility of such damages
#
#################################################################################
#
# Written by Matthew Byrd
# Matbyrd@microsoft.com
# Last Updated 10.15.09
# Parameter to get a different name than default for the new Role
Param([string]$name="MyDistributionGroupsManagement",[string]$policy="Default Role Assignment Policy",[switch]$creategroup,[switch]$removegroup)
# Help Function
Function Show-Help {
"
This script is will create or manage a management role designed to allow users to modify groups that they already own
but not create or remove any new distribution groups.
Switches:
-name Name of the managment role you want to create or modify
Defaults to: `"MyDistributionGroupsManagmenet`"
-policy Name of the Role Policy you want to assign the role to
Defaults to: `"Default Role Assignement Policy`"
-creategroup Adds or Removes the ability of the Role to Create DLs
-removegroup Adds or Removes the ability of the Role to Remove DLs
Examples:
--------------------------------------------
This will Use the default names and Policy and will create a role that cannot
Create or remove groups but can still modify them. If the role already exists
It will modify it by removing or adding the abiltity to create and remove groups
based on the current state.
Manage-GroupManagementRole -CreateGroup -RemoveGroup
"
}
# Function to modify a role by removing or adding Role Entries
# If no action is passed we assume remove
# $roleentry should be in the form Role\Roleentry e.g. MyRole\New-DistributionGroup
Function ModifyRole {
Param($roleenty,$action)
Switch ($action){
Add {Add-ManagementRoleEntry $roleenty -confirm:$false}
Remove {Remove-ManagementRoleEntry $roleenty -confirm:$false}
Default {Remove-ManagementRoleEntry $roleenty -confirm:$false}
}
}
If (($creategroup -eq $false) -and ($removegroup -eq $false)){
Show-Help
exit
}
# Test if we have a role that already has that name
If (([bool](Get-Managementrole $name -erroraction Silentlycontinue)) -eq $true){
Write-Warning "Found a Role with Name: $name"
Write-Warning "Trying to Modify Existing Role"
}
Else {
# Create the new Management Role
Write-Host "Creating Managmenet Role $name"
New-ManagementRole -name $name -parent MyDistributionGroups
}
# Determine if we have the New and Remove Role Entries on the Role Already
$create = [bool](Get-managementroleentry $name\New-DistributionGroup -erroraction Silentlycontinue)
$remove = [bool](Get-managementroleentry $name\Remove-DistributionGroup -erroraction Silentlycontinue)
# If we have the switch CreateGroup add or remove the RoleEntry for New-DistributionGroup
If ($creategroup -eq $true){
If ($create -eq $true){ModifyRole $name\New-DistributionGroup Remove;Write-Host "Removing ability to create distribution Groups from $name"}
elseif ($create -eq $false) {ModifyRole $name\New-DistributionGroup Add;Write-Host "Adding ability to create distribution Groups to $name"}
}
# If we have the switch RemoveGroup add or remove the RoleEntry for New-DistributionGroup
If ($removegroup -eq $true){
If ($remove -eq $true){ModifyRole $name\Remove-DistributionGroup Remove;Write-Host "Removing ability to create distribution Groups from $name"}
elseif ($remove -eq $false) {ModifyRole $name\Remove-DistributionGroup Add;Write-Host "Adding ability to create distribution Groups to $name"}
}
# Test if we have the assignment for the Role and Policy
# If we do ... write a warning
# If not create a new assignment
If (([bool](get-managementroleassignment $name-$policy -erroraction SilentlyContinue)) -eq $true){
Write-Warning "Found Existing Role Assignment: $name-$policy"
Write-Warning "Making no modifications to Role Assignments"
}
Else {
# Assign the Role to the Role Policy
Write-Host "Creating Managmenet Role Assignment $name-$policy"
New-ManagementRoleAssignment -name ($name + "-" + $policy) -role $name -policy $policy
}
#!/bin/bash mount -t smbfs //username:password@windowsserver/pictures /Users/laurence/Mount rsync -urz /Users/laurence/Pictures/iPhoto\ Library/Masters /Users/laurence/Mount/iPhoto umount /Users/laurence/Mount
Remove-MailboxDatabaseCopy DB1\MBX1
Remove-DatabaseAvailabilityGroupServer -Identity DAG1 -MailboxServer MBX1 -ConfigurationOnly
Add-DatabaseAvailabilityGroupServer -Identity DAG1 -MailboxServer MBX1
Add-MailboxDatabaseCopy -Identity DB1 -MailboxServer MBX1
xe vm-list name-label={VM Name} params=dom-id
list_domains
/opt/xensource/debug/destroy_domain -domid <dom id>
xe vm-reset-powerstate vm={VM Name} force=true
xe-toolstack-restart
the SP.JS file should be available from the standard installation folder of SharePoint 2010
.\StartDagServerMaintenance.ps1 -server server1
.\StopDagServerMaintenance.ps1 -server server1
esxupdate –bundle=/tmp/driver.zip update
reboot
SELECT [Name]
FROM [AppSensePersonalizationDB].[dbo].[User]
WHERE [DomainName] = 'DOMAIN'
Please note, my DB name is AppSensePersonalizationDB, yours probably has different name
Then save the result as a txt file, e.g. users.txt, which has entry like the following:
user1
user2
user3
You have to install AppSense EM Manager Tools to be able to use the EMPRegUtil. Once installed, create a batch file:
@echo off
SET EMPRegUtilConnectionString=Data Source=EMDB;Initial Catalog=AppSensePersonalizationDB;Integrated Security=SSPI
for /f "tokens=*" %%i IN (users.txt) DO call:doit %%i
:doit
if "%~1" == "" goto end
@echo %~1
@echo exporting MS Office 2010 Outlook profiles...
EMPRegUtil EXPORT DOMAIN\%~1 "Production" "MS Office 2010" "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook" C:\temp\%~1.reg
@echo deleting MS Office 2010 Outlook profiles...
EMPRegUtil DELETE DOMAIN\%~1 "Production" "MS Office 2010" "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem"
@echo deleting Session Data Outlook profiles...
EMPRegUtil DELETE DOMAIN\%~1 "Production" "Session Data" "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem"
@echo importing to Session Data Outlook profiles...
EMPRegUtil IMPORT DOMAIN\%~1 "Production" "Session Data" C:\temp\%~1.reg
:end
Please note:
my database server name is: EMDB
Run the batch script, it will export the Outlook profile from Managed application, delete the registry from managed application, delete the registry from session data and import the registry back to session data
Restore-Mailbox -RSGMailbox 'Doe, John' -RSGDatabase 'Recovery Storage Group\Mailbox Database 01' -id 'new mailbox' -TargetFolder 'myFolder'