Powershell script to update mailbox search
I am trying to update a mailbox search using a powershell script:
Stop-MailboxSearch -Identity "LitHolds" -confirm:$false
$members = (import-csv -Path "Path"| ForEach-Object{$_.SamAccountName})
foreach ($user in $members)
Set-MailboxSearch -Identity "LitHolds" -SourceMailboxes $user.samaccountname
Start-MailboxSearch -Identity "LitHolds" -confirm:$false
I essentially have our sysadmins populating a csv file and then they run this script manually every night with the latest updates. They are telling me that the mailbox search is empty.
When I run the script I am getting a watson error immediately after with the following:
WARNING: An unexpected error has occurred and a Watson dump is being generated: Value cannot be null.
Parameter name: legacyDN
Value cannot be null.
Parameter name: legacyDN
+ CategoryInfo : NotSpecified: (:) [Stop-MailboxSearch], ArgumentNullException
+ FullyQualifiedErrorId : System.ArgumentNullException,Microsoft.Exchange.Management.Tasks.StopMailboxSearch
+ PSComputerName : Exchange Server Name
What I don't understand is why it's looking for a legacyDN??
Anyone able to do something similar?
Chuck
Hi Chuck,
I would like to verify if you have a legacy Exchange.
The LegacyDN property indicates the legacyDN of the mailbox and matches the legacyExchangeDN attribute of the user object in Microsoft Active Directory.
If there is any update, please feel free to let me know.
Best regards,
Amy
Amy Wang
TechNet Community Support
Similar Messages
-
Powershell Script to Update Central PolicyDefintions Store against the local machine
Hi all,
i've created a powershell script to update my central policydefinitions store against a local machine for example the newest domaincontroller or member server. It can be started with the parameters -source (for the source directory e.g. C:\Windows\PolicyDefinitions)
and -destination (for the target directory e.g. C:\Windows\SYSVOL_DFSR\sysvol\domain.local\Policies\PolicyDefinitions).
It checks the source directory for language folders and admx files. Compares the Fileage with the files in the target directory and allows you to replace them. Maybe this script is helpful for one of you and maybe someone can check it and give me some feedback
to make this script better.
Please be very careful with this and try it on your own risk. You should try it in a testenvironment first. Or e.g. against an empty target directory. In the first version the script asks for confirmation for every single change against the target directory.
You can find it here: http://pastebin.com/dwJytWck
RegardsHi,
You may also want to add this script to the script repository:
https://gallery.technet.microsoft.com/scriptcenter
That'll make it easier for more people to find.
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing) -
Exchange PowerShell script to get mailbox properties of user from a CSV file
Hi Team,
I've a CSV file with alias of numerous users and I want to get their mailbox sizes and other properties. These users are dispersed in various databases of same Exchange organization.
Need a Powershell Script, Any help?
Muhammad Nadeem Ahmed Sr System Support Engineer Premier Systems (Pvt) Ltd T. +9221-2429051 Ext-226 F. +9221-2428777 M. +92300-8262627 Web. www.premier.com.pkYou can use this and modify it to what you need. Output to a file (IE: Export-CSV "path to file"
If you need more specifics let me know. This one is for one user at a time but can be used to read a CSV file.
# Notifies the user a remote session needs to be started
Write-Host "Get a users mailbox size" -fore yellow -back red;
Write-Host "Please wait while a remote session started" -fore red -back yellow;
# Import a remote session with exchange
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://exchangeservername/Powershell/ -Authentication Kerberos
Import-PSSession $Session
Do {
# Prompts user for a name
$name = Read-Host "Enter a username"
# Get the mailbox statistics for that user
Get-MailboxStatistics $name | fl totalitemsize, storagelimitstatus, totaldeleteditemsize | out-default
# Give the user a choice to test another or EXIT
$Output = Read-Host "Press Y to continue or ENTER to exit"
# Ends the program if the user does not press Y
Until ($Output -ne "Y")
HossFly, Exchange Administrator -
PowerShell script to update quick launch navigation.
Hi,
We recently did some reorganization, which involved nesting some sites within others. Some of these sites were based on a custom template, and as a consequence, the quick launch URLs, although relative, did not update. I found some potentially
useful PowerShell script, from
here.
function Repair-SPLeftNavigation {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)][System.String]$Web,
[Parameter(Mandatory=$true)][System.String]$FindString,
[Parameter(Mandatory=$true)][System.String]$ReplaceString
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$SPWeb = Get-SPWeb $Web
$SPWeb.Navigation.QuickLaunch | ForEach-Object {
if($_.Url -match $FindString){
$linkUrl = $_.Url
Write-Host "Updating $linkUrl with new URL"
$_.Url = $_.Url.Replace($FindString,$ReplaceString)
$_.Update()
$_.Children | ForEach-Object {
if($_.Url -match $FindString){
$linkUrl = $_.Url
Write-Host "Updating $linkUrl with new URL"
$_.Url = $_.Url.Replace($FindString,$ReplaceString)
$_.Update()
$SPWeb.Dispose()
The problem I see is that the original URL string is '/data/studysites/site' and the replacement URL is '/researchers/data/studysites/site', and it looks like this script would go through and repair the incorrect links while
breaking the correct ones.
I'm trying to use the -like operator instead of the -match operators to match the $FindString based on a URL that
begins with '/data/studysites/site' rather than contains it, which should (I'm thinking) exclude correct links (which already start with '/researchers.'). This isn't going well though. I am guessing I don't understand how to use the -like
operator with wilodcard variables. Here's what I came up with.
function Repair-SPLeftNavigation {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)][System.String]$Web,
[Parameter(Mandatory=$true)][System.String]$FindString,
[Parameter(Mandatory=$true)][System.String]$ReplaceString
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$SPWeb = Get-SPWeb $Web
$SPWeb.Navigation.QuickLaunch | ForEach-Object {
if($_.Url -like '$FindString*'){
$linkUrl = $_.Url
Write-Host "Updating $linkUrl with new URL"
$_.Url = $_.Url.Replace($FindString,$ReplaceString)
$_.Update()
$_.Children | ForEach-Object {
if($_.Url -like '$FindString*'){
$linkUrl = $_.Url
Write-Host "Updating $linkUrl with new URL"
$_.Url = $_.Url.Replace($FindString,$ReplaceString)
$_.Update()
$SPWeb.Dispose()
}#endFunction
Help much appreciated!Hi Mike,
Tried that, and in that case, it didn't seem to do anything.
function Repair-SPLeftNavigation {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)][System.String]$Web,
[Parameter(Mandatory=$true)][System.String]$FindString,
[Parameter(Mandatory=$true)][System.String]$ReplaceString
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$SPWeb = Get-SPWeb $Web
$SPWeb.Navigation.QuickLaunch | ForEach-Object {
if($_.IsExternal -AND $_.Url -like "$FindString*"){
$linkUrl = $_.Url
Write-Host "Updating $linkUrl with new URL"
$_.Url = $_.Url.Replace($FindString,$ReplaceString)
$_.Update()
$_.Children | ForEach-Object {
if($_.IsExternal -AND $_.Url -like "$FindString*"){
$linkUrl = $_.Url
Write-Host "Updating $linkUrl with new URL"
$_.Url = $_.Url.Replace($FindString,$ReplaceString)
$_.Update()
$SPWeb.Dispose()
I ran the script, adding the -verbose flag, and got this:
PS C:\Scripts> Repair-SPLeftNavigation -Web http://loki/researchers/data/WHIStudies/StudySites/ -FindString "/data/WHIStudies/StudySites" -ReplaceString "/researchers/data/WHIStudies/StudySites" -Verbose
VERBOSE: Leaving BeginProcessing Method of Get-SPWeb.
VERBOSE: Leaving ProcessRecord Method of Get-SPWeb.
VERBOSE: Leaving EndProcessing Method of Get-SPWeb.
PS C:\Scripts>
I then tried expanding the quotes to include the whole IF statement:
function Repair-SPLeftNavigation {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)][System.String]$Web,
[Parameter(Mandatory=$true)][System.String]$FindString,
[Parameter(Mandatory=$true)][System.String]$ReplaceString
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$SPWeb = Get-SPWeb $Web
$SPWeb.Navigation.QuickLaunch | ForEach-Object {
if("$_.IsExternal -AND $_.Url -like '$FindString*'"){
$linkUrl = $_.Url
Write-Host "Updating $linkUrl with new URL"
$_.Url = $_.Url.Replace($FindString,$ReplaceString)
$_.Update()
$_.Children | ForEach-Object {
if("$_.IsExternal -AND $_.Url -like '$FindString*'"){
$linkUrl = $_.Url
Write-Host "Updating $linkUrl with new URL"
$_.Url = $_.Url.Replace($FindString,$ReplaceString)
$_.Update()
$SPWeb.Dispose()
This got me the following error. It seems it is trying to "fix" some URLs that don't need fixing, but not fixing those that do. :)
Updating /researchers/data/WHIStudies/StudySites/AS297 with new URL
Exception calling "Update" with "0" argument(s): "Cannot open "/researchers/researchers/data/WHIStudies/StudySites/AS297": no such file or folder."
At C:\Scripts\Repair-SPLeftNavigation.ps1:15 char:9
+ $_.Update()
+ ~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SPException
Thanks!
Josh -
PowerShell Script for updating accounts in CSV
Hi Experts...!!!!
I need to have a power shell script that can update the status(Enable/disable) accounts given in a .csv file with DNs of the user accounts in it....
Any suggestions...
Thank You...
TechSpec90I recommend that you start by searching for answers:
This comes up as the first item in a search:
https://technet.microsoft.com/en-us/library/ee617200.aspx
\_(ツ)_/ -
Hi All,
I have the below script which gives me the Exchange database names with the number of mailboxex in it.
(get-mailboxdatabase) | foreach-object {write-host $_.name (get-mailbox -database $_.name).count}
What i want is i also need the Server name and the DAG name (If possible) in this script so i get the output in the below format
What i get is:
Database name | No of mailboxes in the DB
XXXXX 250
What i want is:
Server name | Database name | No of mailboxes in the DB | DAG name (If possible)
XXXXXX XXXXXXX 250
DAG01
Can any one help me in making this script plz.
Gautam.75801Hi Peter,
Script works well and Good. But i cannot export the same in a CSV File. I used the below commands. But the output csv file is empty. I can just view the data in the monitor in the powershell window.
Any idea how can i export this in CSV ?
(get-mailboxdatabase) | foreach-object {write-host $_.Server, $_.name (get-mailbox -resultsize
unlimited -database $_.name).count, $_.masterserveroravailabilitygroup} | Export-csv -Path C:\Rpt.csv
And
(get-mailboxdatabase) | foreach-object {write-host $_.Server, $_.name (get-mailbox -resultsize
unlimited -database $_.name).count, $_.masterserveroravailabilitygroup} >C:\Rpt.csv
Gautam.75801 -
need to run through a list of old to new data (.csv) file and change them in a sharepoint list - can not make it work
here is my base attempt.
$web = Get-SPWeb site url
$list = $web.lists["List Name"]
$item = $list.items.getitembyid(select from the items.csv old)
$modifiedBy = $item["Editor"]
#Editor is the internal name of the Modified By column
$item["old"] = "new from the .csv file parsed by power sehll
$ite.Syste,Update($false);
$web.Dispose()Hi,
According to your description, my understanding is that you want to update SharePoint field value from a CSV file recursively.
We can import CSV file using the Import-CSV –path command, then update the field value in the foreach loop.
Here is a code snippet for your reference:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$csvVariable= Import-CSV -path "http://sp2010.contoso.com/finance/"
# Destination site collection
$WebURL = "http://sp2010.contoso.com/sites/Utility/"
# Destination list name
$listName = "Inventory"
#Get the SPWeb object and save it to a variable
$web = Get-SPWeb -identity $WebURL
#Get the SPList object to retrieve the list
$list = $web.Lists[$listName]
#Get all items in this list and save them to a variable
$items = $list.items
#loop through csv file
foreach($row in $csvVariable)
#loop through SharePoint list
foreach($item in $items)
$item["ID #"]=$row."ID #"
$item.Update()
$web.Dispose()
Here are some detailed articles for your reference:
http://blogs.technet.com/b/stuffstevesays/archive/2013/06/07/populating-a-sharepoint-list-using-powershell.aspx
http://social.technet.microsoft.com/wiki/contents/articles/25125.sharepoint-2013-powershell-to-copy-or-update-list-items-across-sharepoint-sites-and-farms.aspx
Thanks
Best Regards
Jerry Guo
TechNet Community Support -
PowerShell script to update ContentType of existing records in Document Library
we are using Document Library in SharePoint 2010 environment. there are about 200 document
present in the document library which have been identified (based on location - England and employee type - FT) and now i have to change the content type of these 200 documents to a new content type 'New FT'. I'm using the below power shell code for the purpose
$webUrl = "http://www.site.com/sites/Library/"
$web = Get-SPWeb -Identity $webUrl
$list = $web.Lists["CURRENT FTE"]
$spQuery = New-Object Microsoft.SharePoint.SPQuery
$spQuery.ViewAttributes = "Scope='Recursive'";
$spQuery.ListItemCollectionPosition = $listItems.ListItemCollectionPosition
foreach($item in $listItems)
$lookup = [Microsoft.SharePoint.SPFieldLookupValue]$item["ROLE"];
$role = $lookup.LookupValue;
$EMPTYPE = $item["EMP TYPE"]
$lookup4 = [Microsoft.SharePoint.SPFieldLookupValue]$item["Location"];
$LOCATION = $lookup4.LookupValue;
$ContentTypeName = $item.ContentType.Name
$ContentTypeID = $item.ContentType.Id
if ($LOCATION -eq "England")
if($EMPTYPE -eq "FT")
#CheckList - 1
Write-Output "ID - $($item.id) "
Write-Output "Name - $($item.name)"
Write-Output "Role - $($role) "
Write-Output "emptype - $($EMPTYPE) "
Write-Output "location - $($LOCATION) "
Write-Output "Content Type Name - $($ContentTypeName) "
Write-Output "Content Type ID - $($ContentTypeID) "
Write-Output " "
$newct = $list.ContentTypes["New FT"]
$newctid = $newct.ID
If (($newct -ne $null) -and ($newctid -ne $null))
$item["ContentTypeId"] = $newctid
$item.Update()
$newContentTypeName = $item.ContentType.Name
$newContentTypeID = $item.ContentType.Id
#CheckList - 2
Write-Output "ID - $($item.id) "
Write-Output "Name - $($item.name)"
Write-Output "Role - $($role) "
Write-Output "emptype - $($EMPTYPE) "
Write-Output "location - $($LOCATION) "
Write-Output "Content Type Name - $($newContentTypeName) "
Write-Output "Content Type ID - $($newContentTypeID) "
Write-Output " "
Now the code identifies each document/record and then prints the details as listed on CheckList - 1, then i do an update and try to print the new updated values in CheckList
- 2 - but the problem is the CheckList -2 doesn't print the updated content type and updated content type ID ($newContentTypeName, $newContentTypeID).
Am i doing some thing wrong here , Please advise ! (feel free to update the code if necessary)Hi,
I suggest you consider the Check Out status of these documents before change the content type.
You can take the code from the link below for a test in your environment:
http://get-spscripts.com/2010/10/change-content-type-set-on-files-in.html
Best regards
Patrick Liang
TechNet Community Support -
Update a filed value with powershell script with ordery by and where condition
Hi
I have below powershell script to update list columns but how i update a field value with ordery by a column and where condition
below is the part of my script
$list = $web.Lists[$listName]
$items = $list.items
$internal_counter = 1
#Go through all items
foreach($item in $items)
if($item["CourtNO"] -eq $null)
#if($item["CourtNo"] -eq '1')
$item["CaseNo"] = $internal_counter
#how to add a column ordery by Title
# and where Title field value from 1 to 10
$internal_counter++
adilHi,
You mean that you only need to update all items with Title field value in range 1..10 and order by them before run the loop statement update?
If so, use CAML query to get the items only match the condition.
#Build Query
$spQuery = New-Object Microsoft.SharePoint.SPQuery
$query = '<Where><And><Gte><FieldRef Name="Title" /><Value Type="Text">0</Value></Gte><Lte><FieldRef Name="Title" /><Value Type="Text">10</Value></Lte></And></Where><OrderBy><FieldRef
Name="Title"/></OrderBy>'
$spQuery.Query = $query
$spQuery.RowLimit = $list.ItemCount
$items = $list.GetItems($spQuery)
Hope this help!
/Hai
Visit my blog: My Blog | Visit my forum:
SharePoint Community for Vietnamese |
Bamboo Solution Corporation -
Script Powershell In Place Hold Mailbox with Exchange 2010
Hello,
I have a script that allows me to make a InPlaceHold newly created mailboxes via Exchange 2010.
But every time I run, he released me an error message: See attached picture.
Here is the script in question:
#Initialize variables
$policyname = "In Place - Hold"
$members = Import-CSV "C:\migration\Script\New_User\New_User_List.csv" -delimiter ";"
$Result = "C:\migration\Script\New_User\New_User_Result.log"
$powerUser = "******"
$powerPass = "******"
$password = ConvertTo-SecureString $powerPass -AsPlainText -Force
$adminCredential = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $powerUser,$password
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $adminCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
#Get current mailboxes in our mailbox search
$InPlaceHoldMailboxes = (Get-MailboxSearch $policyname).sourceMailboxes
#Add another user to the array, the line bellow can be a loop of more than one user.
foreach ( $member in $members)
if ($InPlaceHoldMailboxes -contains($member.name))
Write-Host $("User " + $member.name + " already present") -ForegroundColor:yellow
Out-File -FilePath $Result -InputObject $("IN-PLACE HOLD - WARNING, User " + $member.name + " already present in members") -Encoding UTF8 -append
else
$InPlaceHoldMailboxes += $member.upn
Write-Host $("User " + $member.name + " added") -ForegroundColor:green
Out-File -FilePath $Result -InputObject $("IN-PLACE HOLD - SUCCESS, User " + $member.name + " added to members") -Encoding UTF8 -append
#Add them to the MailboxSearch
Try
Set-MailboxSearch $policyname -SourceMailboxes $InPlaceHoldMailboxes -Force -ErrorAction 'Stop'
Write-Host $("SUCCESS, " + $policyname + " updated") -ForegroundColor:green
Out-File -FilePath $Result -InputObject $("IN-PLACE HOLD - SUCCESS, " + $policyname + " updated") -Encoding UTF8 -append
Catch
Write-Host $("ERROR, policie " + $policyname + " NOT updated") -ForegroundColor:red
Out-File -FilePath $Result -InputObject $("IN-PLACE HOLD - ERROR, " + $policyname + " NOT updated") -Encoding UTF8 -append
Write-Error $_.Exception.ToString() > $Result
Exit
#start the mailboxsearch
Start-MailboxSearch -Identity $policyname -Force
Remove-PSSession $Session
I use Powershell 4.0
Thank you for your help.Please read the error message carefully as it tells you what is wrong. "You cannot update multiple mailboxes". You must do one at a time.
¯\_(ツ)_/¯ -
Compliance Settings Adobe flash Player disable Automatic Updates Powershell Scripts fail
Hello,
I have setup compliance to check and remediate if Adobe flash Player automatic updates is enabled by using PowerShell scripts.
If I run the scripts below manually on my pc they work fine, but if I run in sccm 2012 compliance I get:
Setting Discovery Error
0x87d00327
Script is not signed
CCM
I tried contacting the person that created the scripts, but didn't get a response.
Discovery Script
Set-ExecutionPolicy Unrestricted -force
<#
This script will check if automatic updates is disabled and return a Compliant/Non-Compliant string.
Created: 04.08.2014
Version: 1.0
Author: Odd-Magne Kristoffersen
Homepage: https://sccmguru.wordpress.com/
References:
- Configure auto-update notification Flash Player
http://helpx.adobe.com/flash-player/kb/administration-configure-auto-update-notification.html
- Adobe Flash Player Administration Guide for Flash Player 14
http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/flashplayer/pdfs/flash_player_14_0_admin_guide.pdf
- Adobe Flash Player Administration Guide for Microsoft Windows 8
http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/flashplayer/pdfs/flash_player_13_0_admin_guide.pdf
#>
$OSArchitecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture
If($OSArchitecture.OSArchitecture -ne "32-bit")
$CFGExists = Test-Path -Path "$Env:WinDir\SysWow64\Macromed\Flash\mms.cfg"
if($CFGExists -eq $True)
{$UpdateCheck = Select-String "$Env:WinDir\SysWow64\Macromed\Flash\mms.cfg" -pattern "AutoUpdateDisable=1" | Select-Object Line}
if($UpdateCheck.Line -eq 'AutoUpdateDisable=1') {Write-Host 'Compliant'}
else {Write-Host 'Non-Compliant'}
else
$CFGExists = Test-Path -Path "$Env:WinDir\System32\Macromed\Flash\mms.cfg"
if($CFGExists -eq $True)
{$UpdateCheck = Select-String "$Env:WinDir\System32\Macromed\Flash\mms.cfg" -pattern "AutoUpdateDisable=1" | Select-Object Line}
if($UpdateCheck.Line -eq 'AutoUpdateDisable=1') {Write-Host 'Compliant'}
else {Write-Host 'Non-Compliant'}
Remediation Script
Set-ExecutionPolicy Unrestricted -force
<#
This script will check if automatic updates is disabled and return a Compliant/Non-Compliant string.
Created: 04.08.2014
Version: 1.0
Author: Odd-Magne Kristoffersen
Homepage: https://sccmguru.wordpress.com/
References:
- Configure auto-update notification Flash Player
http://helpx.adobe.com/flash-player/kb/administration-configure-auto-update-notification.html
- Adobe Flash Player Administration Guide for Flash Player 14
http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/flashplayer/pdfs/flash_player_14_0_admin_guide.pdf
- Adobe Flash Player Administration Guide for Microsoft Windows 8
http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/flashplayer/pdfs/flash_player_13_0_admin_guide.pdf
#>
$OSArchitecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture
If($OSArchitecture.OSArchitecture -ne "32-bit")
$CFGExists = Test-Path -Path "$Env:WinDir\SysWow64\Macromed\Flash\mms.cfg"
if($CFGExists -eq $True)
{$UpdateCheck = Select-String "$Env:WinDir\SysWow64\Macromed\Flash\mms.cfg" -pattern "AutoUpdateDisable=1" | Select-Object Line}
if($UpdateCheck.Line -eq 'AutoUpdateDisable=1') {Write-Host 'Compliant'}
else {Write-Host 'Non-Compliant'}
else
$CFGExists = Test-Path -Path "$Env:WinDir\System32\Macromed\Flash\mms.cfg"
if($CFGExists -eq $True)
{$UpdateCheck = Select-String "$Env:WinDir\System32\Macromed\Flash\mms.cfg" -pattern "AutoUpdateDisable=1" | Select-Object Line}
if($UpdateCheck.Line -eq 'AutoUpdateDisable=1') {Write-Host 'Compliant'}
else {Write-Host 'Non-Compliant'}
Thanks,
MarkHi Jeff,
You were correct, Default client settings was set to All signed and once I set to bypass, PowerShell Scripts executed. But now I am getting: If I run them both from PowerShell, they work fine. Thanks again for your help, Mark
Error Type
Error Code
Error Description
Error Source
Enforcement Error
0x87d00329
Application requirement evaluation or detection failed
CCM -
Powershell script for mailbox permissions
Hello,
Part of my tasks as an Exchange admin is to give access to shared mailboxes. The access usually are:
Send AS
Receive As
Send on Behalf Of
Full mailbox
Is there a powershell script out there that does all of the above?
thanks,
AlexisHi,
Probably not prewritten, but you can check the repository for starters:
http://gallery.technet.microsoft.com/scriptcenter
EDIT: I should mention - this isn't too hard to write, so this could be a good opportunity to learn how to get around in the EMS.
Don't retire TechNet! -
(Don't give up yet - 12,830+ strong and growing) -
How can I script Firefox updates using vbScript, PowerShell or C#?
I would like to script Firefox updates using vbScript, PowerShell or C#, are there any API calls I use to do this? There are several different OS version versions that I support and auto update is not an option. I do updates at a specific time of the month. I would like to write a script that would download and install the update for the currently installed version of Firefox (32 or 64 bit) for the version of the OS (32 or 64bit). I can detect the OS version and the Firefox version. I can download updates but I do not want to hard code anything.
hello, for some documentation on how the firefox updates work, please refer to https://wiki.mozilla.org/Software_Update (also the links at the bottom of the page!).
-
Get the daily incremental search crawl information using PowerShell script
Dear Friends ,
I want to get the daily incremental search crawl information using PowerShell script . I need this information into CSV or txt format . Can you please help me with this.
valmikiHi
I have got the below script which worked .
## SharePoint Reference
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Administration")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.Search.Administration")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.Search")
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
function global:Get-CrawlHistory($url)
trap [Exception] {
write-error $("ERROR: " + $_.Exception.GetType().FullName);
write-error $("ERROR: " + $_.Exception.Message);
continue;
$s =
new-Object Microsoft.SharePoint.SPSite($url);
$c = [Microsoft.Office.Server.Search.Administration.SearchContext]::GetContext($s);
$h =
new-Object Microsoft.Office.Server.Search.Administration.CrawlHistory($c);
Write-OutPut $h.GetCrawlHistory();
$s.Dispose();
Get-CrawlHistory
-url http://your_site_url/
|
Export-CsvF:\temp\search.csv
valmiki -
Hi,
I want to force group policy on a collection of computers remotely.The name of computers can be stored in a text file.
By using this info. (about computer names) , Could you please guide me writing a Powershell script for this.
Thanks in advance.
DayaThis requires that PSRemoting is enabled in your environment.
$Computers = Get-Content -Path 'C:\computers.txt'
Invoke-Command -ComputerName $Computers -ScriptBlock {
GPUpdate /Force
Maybe you are looking for
-
How to make a login system using xCode?
Hello guys! I'm trying to make a login system; Is it possible to make it like this: Put a text box for the username and password and a label called "Sign in" How can I make so that the username and password box get's my input box on my PHP website an
-
Hi there I need to install a GoldenGate solution for replication on my job. But, I installed a GoldenGate Veridata that controls the Jobs throught Groups of Objects, Nice. But I really need a Replication Software and I dont found the steps to downloa
-
"For a video, or music iPod"
When an iPod accessory says, "For a video, or music iPod" will it work with an iPod Touch that has video and music?
-
Cisco 2921 destination NAT for transparent proxy
Hi All, I can successfully destination-nat all outbound port 80 and 443 connections to a remote proxy server without issue, provided I use a PBR first to push any of these connections off to a Linux box. In iptables its easy: iptables -t nat -A PRERO
-
Return status is S but assignment id is not created
I have To Assign to resource to project for that ihave used pa assignment Pub. Create assignment api. Given all parameter but run well return status S but assignment id return null. Please help