Create & Start UPS Service Using Power-Shell in SharePoint 2013
I want to know that is there a way to create a User Profile Synchronization Service using Power-Shell in a SharePoint 2013 Enterprise site? If so then how am I supposed to do that and start the User Profile Synchronization Service using the Power-Shell.
I'm seeking this help because the UPS service is stuck in Starting and both FIM Services are also not started but they are in Automatic start mode.
Could someone try to solve this matter.
Thanks,
regards,
Chiranthaka
start it from powershell will not help you resolve the issue.
Try below articles:
http://myspexp.com/2011/04/28/user-profile-synchronization-servicehangs-on-starting-i-fixed-it/
troubleshoot this issue:http://www.harbar.net/articles/sp2010ups2.aspx
http://www.sharepointdiary.com/2012/09/user-profile-synchronization-service-stuck-at-starting.html#ixzz2aXArH7zX
Similar Messages
-
New-CMGlobalCondition unable to create New script Condition using Power Shell
I am using config Manger 2012 and trying to use power shell cmdlet to create a new Global Condition using PowerShell but its not working for me using this
Do not understand how to use that command any idea.
New-CMGlobalCondition -DataType Boolean -DeviceType Windows -FilePath file.ps1 -Name test -ScriptLanguage PowerShell
Error comes as
New-CMGlobalCondition : No object corresponds to the specified parameters.
At line:1 char:1
+ New-CMGlobalCondition -DataType Boolean -DeviceType Windows -FilePath file.ps1 - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Confi...onditionCommand:NewGlobalConditionCommand) [New-CMGlobalCondition], I
temNotFoundException
+ FullyQualifiedErrorId : ItemNotFound,Microsoft.ConfigurationManagement.Cmdlets.AppModel.Commands.NewGlobalConditionCommandHi,
What's your version of SCCM? I ran this command line on SCCM 2012 R2 CU2.
It seems SCCM 2012 R2 CU2 fixed New-CMGlobalCondition cmdlet issue.
"The New-CMGlobalCondition cmdlet incorrectly requires use of the
-WhereClause parameter."
Description of Windows PowerShell changes in Cumulative Update 2 for System Center 2012 R2 Configuration Manager
Best Regards,
Joyce -
Programmatically create SPGroups using power shell
hi,
I wanna create sp groups programmatically using power shell,
can anyone pls point me in the right direction.
i have gone through this code:
$GroupName = "mygrp1"
$owner =""
$member =""
$Description =""
$SPWeb.SiteGroups.Add($GroupName, "", "","")
$SPGroup = $SPWeb.SiteGroups[$GroupName]
$SPWeb.RoleAssignments.Add($SPGroup)
$SPWeb.Dispose()
just wanted to know whether should i add few code related with sproleassignments/ sproeldefintions etc we used to do in SP OM through c#
help is appreciated!There are two parts.
1. Adding a group to the site collection.
2. assigning permissions to the group.
The PS script given below first ensures if the group exists or not and then executes the logic. If the group already exists, then it will not add group the site. I would recommed to test it in Dev environment and then use in Prod.
$site=Get-SPSite $siteCollectionUrl
$rootSite=$site.RootWeb
$member=$rootSite.Users["User_Name"]
$user=$rootSite.Users["Other_User_Name"]
try
$grp=$rootSite.SiteGroups["Group Name"]
catch
if($grp -eq $null)
$rootSite.SiteGroups.Add("Group Name",$member, $user, "Group Description")
$grp=$rootSite.SiteGroups["Group Name"]
$roleDef=$rootSite.RoleDefinitions.GetByType([Microsoft.SharePoint.SPRoleType]::Contributor)
$roleAssigns=New-Object -TypeName Microsoft.SharePoint.SpRoleAssignment -ArgumentList $grp
$roleAssigns.RoleDefinitionBindings.Add($roleDef)
$rootSite.RoleAssignments.Add($roleAssigns)
$rootSite.Update()
Pradip T. ------------- MCTS(SharePoint 2010/Web)|MCPD(Web Development) https://www.mcpvirtualbusinesscard.com/VBCServer/paddytakate/profile -
Hi,
Can anyone pls point me any link/ src code for deplyoing wsp using power shell. I know I can deploy it through Add-spsolution and install-spsolution, the issue is that, it will give "status - stuck in deploying scheduled..."
and i need to restart the sharepoint services - services.msc --> SP administration and timer services - and then i need to run the exceadmsvcjobs command to deploy / update the wsp successfully in solution store.
i mean, whats the power shell equivalent of these tasks. or anyone has already scripted these.
if i elaborate little bit, would like to know how to automatically Retract, Remove, Add and Deploy SharePoint 2010 WSP Solution Files with PowerShellok, i have found the same :
here its : hope this will help someone.
function wait4timer($solutionName)
$solutionName ="TestingWSP.wsp"
$solution = Get-SPSolution | where-object {$_.Name -eq $solutionName}
if ($solution -ne $null)
Write-Host "Waiting to finish soultion timer job" -ForegroundColor Green
while ($solution.JobExists -eq $true )
Write-Host "Please wait...Either a Retraction/Deployment is happening" -ForegroundColor DarkYellow
sleep 5
Write-Host "Finished the solution timer job" -ForegroundColor Green
try
# Get the WebApplicationURL
$MyWebApplicationUrl = "http://srvr:21778/";
# Get the Solution Name
$MywspName = "TestingWSP.wsp"
# Get the Path of the Solution
$MywspFullPath = "D:\myWorkspace\TestingWSP.wsp"
# Try to get the Installed Solutions on the Farm.
$MyInstalledSolution = Get-SPSolution | Where-Object Name -eq $MywspName
# Verify whether the Solution is installed on the Target Web Application
if($MyInstalledSolution -ne $null)
if($MyInstalledSolution.DeployedWebApplications.Count -gt 0)
wait4timer($MywspName)
# Solution is installed in atleast one WebApplication. Hence, uninstall from all the web applications.
# We need to unInstall from all the WebApplicaiton. If not, it will throw error while Removing the solution
Uninstall-SPSolution $MywspName -AllWebApplications:$true -confirm:$false
# Wait till the Timer jobs to Complete
wait4timer($MywspName)
Write-Host "Remove the Solution from the Farm" -ForegroundColor Green
# Remove the Solution from the Farm
Remove-SPSolution $MywspName -Confirm:$false
sleep 5
else
wait4timer($MywspName)
# Solution not deployed on any of the Web Application. Go ahead and Remove the Solution from the Farm
Remove-SPSolution $MywspName -Confirm:$false
sleep 3
wait4timer($MywspName)
# Add Solution to the Farm
Add-SPSolution -LiteralPath "$MywspFullPath"
# Install Solution to the WebApplication
#Install-SPSolution -Identity <SolutionName> -WebApplication <URLName> [-GACDeployment] [-CASPolicies]
install-spsolution -Identity $MywspName -WebApplication $MyWebApplicationUrl -GACDeployment #-FullTrustBinDeployment:$true -GACDeployment:$false -Force:$true
# Let the Timer Jobs get finishes
wait4timer($MywspName)
Write-Host "Successfully Deployed to the WebApplication" -ForegroundColor Green
catch
Write-Host "Exception Occuerd on DeployWSP : " $Error[0].Exception.Message -ForegroundColor Red
ref :
http://www.sharepointpals.com/post/How-to-Deploy-a-SharePoint-2013-Solution-(WSP)-in-the-Farm-using-PowerShell -
Activate design manager (sandbox) solution using power shell - SP2013
Hi All,
I have a design manager (sandbox) solution and deployed in site collection. I am trying to upload the new version using power shell.
Uninstall-SPUserSolution , Remove-SPUserSolution, Add-SPUserSolution and finally doing Install-SPUserSolution on that time i am getting the following error " Install-SPUserSolution : This file may not be moved, deleted,
renamed, or otherwise edited." kindly help me for this issue.
Regards,
SanthoshCan you please provide more details on your solution package? Did you use SharePoint Design Manager to create design package? If that is the case then if you read the following article it reads and
"In SharePoint 2013 you cannot uninstall an imported design package, and you should never attempt to deactivate a design package through the solution gallery."
I think if you read the article it might be helpful.
http://msdn.microsoft.com/en-us/library/jj862342.aspx
Amit -
How do you create an array without using a shell on the FP?
I want to be able to read the status of front panel controls (value, control box selection, etc.) and save it to a file, as a "configuration" file -- then be able to load it and have all the controls set to the same states as were saved in the file. I was thinking an array would be a way to do this, as I have done that in VB. (Saving it as a text file, then reading lines back into the array when the file is read and point the control(s) values/states to the corresponding array element.
So how do I create an array of X dimensions without using a shell on the front panel? Or can someone suggest a better way to accomplish what I am after? (Datalogging doesn't allow for saving the status by a filename, so I
do not want to go that route.)Thanks so much m3nth! This definitely looks like what I was wanting... just not really knowing how to get there.
I'm not sure I follow all the icons. Is that an array (top left with 0 constant) in the top example? And if so, that gets back to part of my original question of how to create an array without using a shell on the FP. Do I follow your diagram correctly?
If I seem a tad green... well I am.
I hope you understand the LabVIEW environment and icons are still very new to me.
Also, I had a response from an NI app. engineer about this problem. He sent me a couple of VI's that he threw together approaching this by using Keys. (I still think you are pointing to the best solution.) I assume he wouldn't mind m
e posting his reply and the VI's for the sake of a good, thorough, Roundtable discussion. So here are his comments with VI's attached:
"I was implementing this exact functionality this morning for an application I'm working on. I only have five controls I want to save, but they are all of different data types. I simply wrote a key for each control, and read back that key on initialization. I simply passed in property node values to the save VI at the end, and passed the values out to property nodes at
the beginning. I've attached my initialize and save VI's for you to view. If you have so many controls that this would not be feasible, you may want to look into clustering the controls and saving the cluster as a datalog file.
Attachments:
Initialize_Settings.vi 55 KB
Save_Settings.vi 52 KB -
hi,
i am having a visual studio custom solution having page layouts implemented. In that solution i am having 1 summary links web part and in that i have hard coded few links and this is deployed on ion dev and staging env.
Now, the issue is : yesterday, customer came to me and asking me to change the links from http://abc to
http://xyz/ in this summary links. can anyone pls throw some light,such that i can change this link using a power shell script. i know if i go the VS solution and change the link and redeploy [ update-spsolution
command] will work.
but if the links are changing regularly , chnaging the vs solution and redeploying is not a good practice.
if i elaborate li'l bit, i am adding the screen shot : i need to get the summary link column's value and need to update[ delete xisting one and add new ones ]
is there any way , i can change the links using power shell script?
i tried the belwo power shells cript to get the page in the page layouts :
$web = get-spweb
"http://siteurl"
$pubWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
$pagesListName = $pubWeb.PagesListName
$defaultAspxFile = $pubWeb.GetPublishingPage("$pagesListName/mycustomhome.aspx")
$summaryLinkFieldValue = New-Object
Microsoft.SharePoint.Publishing.Fields.SummaryLinkFieldValue
// here am getting the NULL VALUE
can i get the summary links field correctly and delete / modify the same?
help is appreciated!
##$groupLink = New-Object
Microsoft.SharePoint.Publishing.SummaryLink("My group")
#$groupLink.IsGroupHeader = $true $summaryLinkFieldValue.SummaryLinks.Add($groupLink)Hi Shabeaut,
Could you tell us why do you want to add a link web part to the master page for all pages?
I tested that Summary Links web part (and other types of web parts) added in the master page under Quick Launch couldn't be edited when I edit the pages inherited from v4.master page, it looks by design.
Have you tried using the Quick Launch to add the link instead if you want to show links in all pages.
Thanks
Daniel Yang
TechNet Community Support -
Using Power shell script how to hidden SharePoint existing features.
Hi Firends,
Using Power shell script how to hidden SharePoint existing features.
Please help me.
Thanks,
Tiru
TiruThe Hidden property is set within the solution, so you would need access to the source code in order to set it.
Trevor Seward
Follow or contact me at...
  
This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs. -
Get the web part properties of documeny lib view web part using power shell
Hi,
Am looking to get the propeties of a list view web part - a document library's list view web part- using PowerShell
Manually I am able to do the same: the steps followed by me is given below:
1) I went to the
http://srvr1:123/sites/enggtest/mydoclib1/forms/allitems.aspx
2) Edit the page
3) Edit the mydoclib1 view web part
4) go to the peroperties
5) Check the Server Render checkbox
is there anyway i can do this using power shell.The code below assumes that the webpart is at index 0:
$SiteUrl = "http://aissp2013/sites/TestSite/"
$pageURL = "http://aissp2013/sites/TestSite/Lists/MyList/AllItems.aspx"
$web = Get-SPWeb $SiteUrl
$wpm = $web.GetLimitedWebPartManager($pageURL, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
$wp = $wpm.WebParts[0]
$wp.ServerRender = $true
$wpm.SaveChanges($wp)
Blog | SharePoint Learnings CodePlex Tools |
Export Version History To Excel |
Autocomplete Lookup Field -
How to get site permissions using power shell ?
Hello,
I require to get list of granted permissions ( Group/users ) which we see from Site Actions > Site Permissions.
would you please let me know how can I fetch the same using power shell ?
Thanks and Regards,
Dipti ChhatrapatiHello,
I have found the same using following script :
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
#Define variables
$site = Get-SPSite "Site collection URL"
#Get all subsites for site collection
$web = $site.AllWebs
#Loop through each subsite and write permissions
foreach ($web in $web)
if (($web.permissions -ne $null) -and ($web.hasuniqueroleassignments -eq "True"))
Write-Output "****************************************"
Write-Output "Displaying site permissions for: $web"
$web.permissions | fl member, basepermissions
elseif ($web.hasuniqueroleassignments -ne "True")
Write-Output "****************************************"
Write-Output "Displaying site permissions for: $web"
"$web inherits permissions from $site"
Write-Host "Finished."
$site.dispose()
$web.dispose()
Hope it helps others !
Thanks and Regards,
Dipti
Dipti Chhatrapati -
How to build high usability navigation for Power View on SharePoint 2013?
I have Power View on SharePoint 2013. I have both SSAS Multidimentional and Tabular model in use.
I have several Report.drlx file in Report libary in SharePoint.
When I click the file, it works fine, but I feel that there are usability problems like:
A) Getting back to SharePoint site is not intuitive. Difficult to find home.
B) Diffucult to move between report to another. Need to return Document library.
What is best practise for displaying several Power View reports on SharePoint?
Kenny_IHi Kenny_I,
Just as you said, we cannot directly navigate to Home page when we view an .rdlx report in SharePoint site. We need click the Arrow to go to the previous page (Document Library), then click “Home” to navigate to Home page. If we want to move from a report
to another report, we should still use the same way. This is by design.
If you want to jump from one report to another report, we can add a hyperlink to a text box in a sheet or view. Personally, I understand your feeling and how frustrated when you find this issue. So, it is my pleasure to help you to reflect your recommendation
to the proper department for their consideration. Please feel free to submit your situation on our product to the following link:
https://connect.microsoft.com/.Your feedback is valuable for us to improve our products and increase the level of service provided.
Thank you for your understanding.
Regards,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
As i am fresher Please share the doc of ECMA script using java script in SharePoint 2013 step by step also how we can insert,update,delete records in list using ECMA script.
Thanks and Regards, Rangnath MaliHi,
According to your post, my understanding is that you want to use JavaScript to work with SharePoint list.
To create list items, we can create a ListItemCreationInformation object, set its properties, and pass it as parameter to the addItem(parameters) function
of the List object.
To set list item properties, we can use a column indexer to make an assignment, and call the update() function so that changes will take effect when you callexecuteQueryAsync(succeededCallback,
failedCallback).
And to delete a list item, call the deleteObject() function on the object.
There is an MSDN article about the details steps of this topic, you can have a look at it.
How to: Create, Update, and Delete List Items Using JavaScript
Thanks & Regards,
Jason
Jason Guo
TechNet Community Support -
Is it supported to use shared mailboxes in SharePoint 2013 Workflows?
We try to send an email to a shared mailbox (Exchange 2007) from a workflow in SharePoint 2013. No errors are shown in the workflow but the message does not arrive in the mailbox. If we do the same with an user mailbox it works.
Both Exchange and SharePoint are on-premises.
Is it supported to use shared mailboxes in SharePoint 2013 Workflows?If it is a mailbox then mail should be delivered.
Please check if mail is in C:\Inetpub\ pickup or drop folder
also check if emails to normal mailbox works fine -
Hi,
I am trying to launch Amazon EC2 windows server 2008 R2 instance using AWS Auto Scaling feature. I have used cusmized AMI in Autoscaling Launch configuration to launch an instance.I have placed Power Shell script in AMI.
The responsibility of script is to download code from AWS S3 and deploy in IIS server while windows startup first time.
When i check status, IIS is started succesfully. But default Application pool is not started.
To resolve this issue i have written one scheduled script. It helps to start the application pool if any application pool is in stopped state.
After this Application pool is started but i am not able to communicate with IIS server through browser.
Please help any one to resolve this issue.
Thanks in advanceHi Vchreddy,
For the IIS issue, we recommend you can post in IIS forum for more effective support:
http://forums.iis.net/
Thanks for your understanding. -
Remote managment Exchange 2013 SP1 from C# code using Power-Shell.
Hello,
Sorry if I am describing something wrong, but it is first time I am using Microsoft development forum.
I am trying to built library that will manage Exchange remotely using C# code (VS 2012) and Power-Shell ver.4.0. My workstation and the actual Exchange server physically placed in different domains. In order to test functionalities I am using
user that is member of all administrating and management groups in the appropriative domain. Remote Power-Shell is enabled on Exchange.
In order to connect to the Service I am using that part of code :
internal static bool RedirectionUrlValidationCallback(string redirectionUrl)
bool result = false;
var redirectionUri = new Uri(redirectionUrl);
if (redirectionUri.Scheme.Equals("https"))
result = true;
return result;
internal static ExchangeService ConnectToService(ExchangeVersion version,
string userName,
string emailAddress,
string password,
string domainName,
ref Uri autodiscoverUrl)
ExchangeService service;
try
service = new ExchangeService(version);
service.Credentials = new WebCredentials(userName, password, domainName);
if (autodiscoverUrl.IsNull())
var ads = new AutodiscoverService();
// Enable tracing.
ads.TraceEnabled = true;
// Set the credentials.
ads.Credentials = service.Credentials;
// Prevent the AutodiscoverService from looking in the local Active Directory
// for the Exchange Web Services Services SCP.
ads.EnableScpLookup = false;
// Specify a redirection URL validation
//callback that returns true for valid URLs.
ads.RedirectionUrlValidationCallback = RedirectionUrlValidationCallback;
// Get the Exchange Web Services URL for the user’s mailbox.
var response = ads.GetUserSettings(emailAddress, UserSettingName.InternalEwsUrl);
// Extract the Exchange Web Services URL from the response.
autodiscoverUrl = new Uri(response.Settings[UserSettingName.InternalEwsUrl].ToString());
// Update Service Url
service.Url = autodiscoverUrl;
else
service.Url = autodiscoverUrl;
catch (FormatException fe) // The user principal name(email) is in a bad format. UPN format is needed.
LoggingFactory.LogException(fe);
return null;
catch (AutodiscoverLocalException ale)
LoggingFactory.LogException(ale);
return null;
catch (Exception e)
LoggingFactory.LogException(e);
return null;
return service;
Then I am trying to reach existing mailbox of that user, using this part of code :
try
var runSpace = getRunspace();
var pwShell = PowerShell.Create();
pwShell.Runspace = runSpace;
var command = new PSCommand();
command.AddCommand("Get-Mailbox");
command.AddParameter("Identity", userPrincipalName);
command.AddParameter("RecipientTypeDetails", recipientType);
pwShell.Commands = command;
var result = pwShell.Invoke();
if (result.IsNotNull() && result.Any())
// TODO : fill appropriative DTO and return it.
else
// TODO : send back appropriative error.
closeRunSpace(runSpace);
catch (Exception e)
// TODO : log the exception and send back appropriative error.
private Runspace getRunspace()
var runSpaceConfig = RunspaceConfiguration.Create();
var runSpace = RunspaceFactory.CreateRunspace(runSpaceConfig);
PSSnapInException snapEx;
var psInfo = runSpaceConfig.AddPSSnapIn("Microsoft.Exchange.Management.PowerShell.E2010", out snapEx);
runSpace.Open();
return runSpace;
private void closeRunSpace(Runspace runSpace)
runSpace.Close();
runSpace.Dispose();
With this part I had problem. I received exception that appropriative Snap-in is not installed on my computer. I had no installation disk of Exchange in order to install Management Tool (as I understand this is the way to add needed part) so I changed run
space activation to that part of code :
private Runspace getRunspace()
var newCredentials = (PSCredential)null;
var connectionInfo = new WSManConnectionInfo(new Uri("http://exchange.domainname.local/powershell?serializationLevel=Full"),
"http://schemas.microsoft.com/powershell/Microsoft.Exchange",
newCredentials);
connectionInfo.AuthenticationMechanism = AuthenticationMechanism.Kerberos;
var runSpace = RunspaceFactory.CreateRunspace(connectionInfo);
runSpace.Open();
return runSpace;
Now I am receiving exception :
"Connecting to remote server exchange.domainname.local failed with the following error message :
[ClientAccessServer=exchange,BackEndServer=exchange.domainname.local,RequestId=....,TimeStamp=...]
Access is denied. For more information, see the about_Remote_Troubleshooting Help topic."
Please help me to understand what I am doing wrong.
Thank you.
Alexander.In Exchange 2010 you should be using Remote Powershell not local powershell and the snap-in. Here is a sample that may help you:
http://blogs.msdn.com/b/dvespa/archive/2009/10/22/how-to-call-exchange-2010-cmdlet-s-using-remote-powershell-in-code.aspx
Maybe you are looking for
-
Hello, i've installed OSX Mountain Lion from Appstore. After installing Mountain lion all i work programs won't open. When i open pages is this wat they say: Process: Pages [302] Path: /Applications/iWork '09/Pages.app/Contents/Mac
-
I updated to OS X Mavericks and now trying to run Logic Pro X on a MacBook Pro mid-2009, using an M-Audio Axiom 49 and an M-Audio Fast Track Pro... Logic keeps telling me that Mac OS X MIDI Services are not available... How do I solve this problem?
-
How to use db transcation for an OleDb token places in a loop?
There comes an interesting problem for you, it seems very easy in code: using (OleDbConnection con = new OleDbConnection(--)) OleDbCommand cmd = new OleDbCommand(con); OleDbTranscation trans = con.BeginTranscation(); cmd.CommandText = "update xxx set
-
Row Selection for second and subsequent level nodes in tree table
Hi All, We have a .jsff page with tree bindings to display a three-level hierarchy tree table.Suppose the hierarchy is -> Department ->-> Employees ->->-> Employee details. I have a use case where-in when we add the employee node within a department,
-
PS CS5.1 - Changes/additions to doc don't appear until I zoom in/out of image
Good evening, Over the past few weeks I've encountered a problem with Photoshop CS 5.1. Anytime I make an addition or alteration to an image (not a photo, but a digital composition) whatever I've done does not appear until I zoom in or out of the ima