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
Tiru
The 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.
Similar Messages
-
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. -
Hi,
Let say, I have 3 parameters.
1. Script FolderPath (Remote path for e.g \\RD101\ScriptSharedFolder Here RD101 is one server)
2. Script Name(StopAllService.ps1)
3. Server Name (RD45)
I want to execute a powershell scritp in my local machine(Test1) and in that script I want to pass the above three parameters.Now I want to excute the StopAllService.ps1 script into RD45 server. But the script is available in RD101 machine.
So What I want to here How can we do this ? I have script name and script folder path and target execution server name.
Pls giude me or give me the script.
By
A Path Finder..
JoSwa
If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful"
Best Online JournalHi,
You got 2 solutions for your problem:
1- If you have permission to run scripts in the remote computer without specifying your credential,
then, the first reply solve your problem.
2- If you have permission to run scripts in the remote computer
having to specify your credential, l then,
my solution solves your problem.
If the remote computer requires signed scripts only, you need signed script. Period. Or are you trying to break remote computer security?
If you need signed script, there's no psdrive that'll circumvent such requirement.
The problem is that the execution policy is set to "RemoteSigned". Using the URL explicitly tags that script as being from a remote source, and the policy blocks it. The PSDrive provides a local reference for the script. It does not
sign the script but the local drive reference may prevent it from being blocked for being from a remote source. I'll test that later.
Script signing is not and should never be considered a security measure. It is easily circumvented by running the script using powershell.exe, and using the -ExecutionPolicy parameter to override whatever the local execution policy setting is.
[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " " -
All,
Hope you are doing great. I have a storage account which is RA-GRS enabled. Which has couple of (IaaS based vms) .vhd. I have taken few snapshots on the VMs too.
Queries:
1. How do I copy the .vhds from secondary storage account to different account in primary location?
2. If I copy the .vhds. Does it copy all the snapshots which was taken?
Please advice. Many thanks!
Regards,
SwamyHi Jambor,
Hope you are doing great. I am facing a problem.
1. Imagine I have a storage account with RA-GRS enabled. US East (Primary) and US West (Secondary)
2. I have created a VM in US East and taken couple of snapshots. Which means the .vhd and its snapshot will be replicated in the Secondary location.
3. Assume that Primary site is down. Not I want to read the .vhd and its snapshot from secondary and create VM in Primary location.
4. I tried the below code but it is throwing exception 404 Not found.
Please advice.
Regards,
Swamy
$client.LocationMode
=0
$createdBlob=$client.GetBlobReferenceFromServer($theDestBlobUrl)
Write-Output$createdBlob.SnapshotQualifiedStorageUri.PrimaryUri.AbsoluteUri
try
$createdBlob.BreakLease()
catch{}
$blobUri125=New-ObjectSystem.Uri($theUrl)
$client.LocationMode
=0
$createdBlob.StartCopyFromBlob($blobUri125.AbsoluteUri)
$blobReference=$client.GetBlobReferenceFromServer($theUrl) -
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 -
Need Power shell script to run on all databases.
Hi,
I have a stored procedure to generate report, using power shell script want to get all databases, run stored procedure on each database and generate the results as .csv file, output the file with database name (place it on directory) and email .csv
file.
looking for script, can any one help pls?
Naveen| Press Yes if the post is useful.Can you please share with me the codes
Naveen| Press Yes if the post is useful.
Dear N_14
You can have a look on the followings
http://www.csharp-station.com/Tutorial/AdoDotNet/lesson07
http://www.codeproject.com/Articles/415732/Reading-and-Writing-CSV-Files-in-Csharp
https://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage%28v=vs.110%29.aspx
Best Regards
mintssoul -
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 -
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,
Chiranthakastart 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 -
HOW TO RUN POWER SHELL SCRIPT UNDER SAFE MODE
hi
is is possible to run the power shell script (with Management instrument code ) in safe mode
if so then how to do it, please explain the procedureHi CHELLAPPA,
Based on my research, we can use powershell in safe mode, and I also tested on server 2012 R2:
You can also open cmd and type "powershell" to use powershell script.
If there is anything else, please feel free to post back.
Best Regards,
Anna Wang -
How to execute power shell script file inside DSC script resource
Hi,
How to execute /call powershell scirpt file inside DSC script resource , some thing like below and capture the status of execution.
Node $AllNodes.NodeName
Script ExecuteSQLDeploy
#SetScript = {powershell.exe .\SQLDeploy.ps1 "param1" "param2" "param3" "param4" "param5" }
#TestScript= {powershell.exe .\SQLDeploy.ps1 "param1" "param2" "param3" "param4" "param5 }
#GetScript= { return $true;}
BasawarajThanks for reply.
Now i am able to execute the power shell script with DSC. I am getting no error when i run , but the script logic wrote inside ( deploying sql incremental changes ) not working . I am using SQLCMD in the powershell script to deploy sql
changes . Can you please elaborate on "script is compatible with DSC" , the script
should not contain write-host cmdlet.... etc something like that.
Copying recursively from ****************************** to ************************** succeeded.
Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
An LCM method call arrived from computer ************ with user sid **********************************************
[V-BAKANT]: LCM: [ Start Set ]
[V-BAKANT]: LCM: [ Start Resource ] [[Script]ExecuteSQLDeploy]
[V-BAKANT]: LCM: [ Start Test ] [[Script]ExecuteSQLDeploy]
[V-BAKANT]: LCM: [ End Test ] [[Script]ExecuteSQLDeploy] in 0.1110 seconds.
[V-BAKANT]: LCM: [ Start Set ] [[Script]ExecuteSQLDeploy]
[V-BAKANT]: LCM: [ End Set ] [[Script]ExecuteSQLDeploy] in 0.3010 seconds.
[V-BAKANT]: LCM: [ End Resource ] [[Script]ExecuteSQLDeploy]
[V-BAKANT]: LCM: [ End Set ]
[V-BAKANT]: LCM: [ End Set ] in 0.8810 seconds.
Operation 'Invoke CimMethod' complete.
Time taken for configuration job to complete is 0.923 seconds
Basawaraj -
Trying to run program off network location using GPO with Power shell script.
Hello All,
Not much of a script writer. I am giving it a shot. My issue is that I need to run a application update across our network and I am trying to do it with as little hands on as possible. So I was planning to push a GPO with a power shell script in it
to run the program with elevated privileges.
Little background:
We are running on a domain and end users do not have admin rights.
The application is stored on a share on our network that is open to all domain users.
The installer user name and password is a temp one and will only be valid for the 30 min window when everyone logs in at the beginning of the day.
So this is what I have so far.
$username = "USER"
$password = "PASSWORD"
$credentials = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))
Start-Process PSQLv11Patch_Client_x86.msp -Credential ($credentials) -WorkingDirectory \\Server\Folder\Folder1\Folder2\filder3\PSQLv11sp3_x32\
But for some reason I keep getting :
Start-Process : This command cannot be run due to the error: The system cannot find the file specified.
At line:10 char:1
+ Start-Process PSQLv11Patch_Client_x86.msp -Credential ($credentials) -WorkingDir ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
Any help you could give would be great.
Thanks,
jdfmonkeyHi jdfmonkey,
Has anyone provided an answer to your original question? I am trying to use Start-Process to launch a process using another logged in user's credentials, and am not able to get it working:
$cred=Get-Credential
start-process Process.exe-WorkingDirectoryC:\Scripts-Credential$cred
I get the same error that you mentioned:
start-process : This command cannot be run due to the error: The system cannot find the file specified.
At C:\Scripts\Process.ps1:2 char:1
+ start-process Process.exe -WorkingDirectory C:\Scripts -Credential ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
When I leave off the credentials:
start-processProcess.exe-WorkingDirectoryC:\Scripts
It works correctly. Does anyone have a solution to make this work correctly?
Please ask your own question. You issue is nothing like the current thread. You clearly are using a user account that has no access to the folder. It is a permissions issue. It is not a scripting issue.
If you need further help please start your own question.
¯\_(ツ)_/¯ -
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 -
How to use "do shell script" when Terminal replies with a prompt?
Hey all,
I'm wondering how to properly use "do shell script" when Terminal replies with a question? In this example, I'm building a small tool in AppleScript that will auto-update the Android SDK via command line prompts. The problem is when I tell it to update all ("update sdk --no-ui"), I need to accept licence agreements before it continues, and the amount of licence agreements brought up is different every time.
So, basically, I'm wondering how to handle a case where "do shell script" encounters a case where Terminal would normally need a user's response to?
Thanks,
BehnIf it is variable number of prompts that is a problem. Look around hd and figure out how many prompts there will be. Ask around android forum for a bash solution. There are some test case apps that will let you put conditionals on output from running programs.
# traditional way. Pipe output to command.
do script "echo 'ok' | update sdk --no-u"
Here is the preferred way of getting administrator privileges.
It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on. Here is an example.
Author: rccharles
For testing, run in the Script Editor.
1) Click on the Event Log tab to see the output from the log statement
2) Click on Run
For running shell commands see:
http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
on run
-- Write a message into the event log.
log " --- Starting on " & ((current date) as string) & " --- "
-- debug lines
set unixDesktopPath to POSIX path of "/System/Library/User Template/"
log "unixDesktopPath = " & unixDesktopPath
set quotedUnixDesktopPath to quoted form of unixDesktopPath
log "quoted form is " & quotedUnixDesktopPath
try
set fromUnix to do shell script "sudo ls -l " & quotedUnixDesktopPath with administrator privileges
display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
on error errMsg
log "ls -l error..." & errMsg
end try
end run -
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 -
Web Service to call Power Shell Script
Hello All,
How can we make a call to power shell script from a asp.net web service with parameter ?
Thanks in AdvanceNormally you can do everything using web service, why do you want to call powershell
May be you can plan
http://geekswithblogs.net/Norgean/archive/2012/09/19/running-powershell-from-within-sharepoint.aspx
Plan to use workflow for same
http://ilovesharepoint.codeplex.com/wikipage?title=Execute%20PowerShell%20Script%20Action
Also check
http://forums.iis.net/t/1161083.aspx?running+PS+scripts+from+a+webpage+sharepoint+site
If this helped you resolve your issue, please mark it Answered
Maybe you are looking for
-
HT203254 NVIDIA GeForce 8600M GT
The official Apple program regarding the Graphics Display: NVIDIA GeForce 8600M GT has ended since December 7th 2012 Today, February 19th 2013 I still have that same problem, and don't know what I can do. I have a MacBook Pro. Anyone has any ideas?
-
HT204380 Is there a way of using the same FaceTime account on multiple devices?
Is there a way of using the same FaceTime account on multiple devices?
-
Error message "the document iweb could not be saved"
Help! I made a few small updates to my already published web site and now when I go to save or publish it I get the message "The document iWeb could not be saved". I have made changes in the past with no issues.... why now and what is the problem? Th
-
You entered an invitee that wasn't recognized by the server
I am running Mac 10.6.7 and iCal 4.0.4. I have an 2010 Exchange account configured in iCal ,and Mac Mail, it has been running fine for over a year now. Recently i have been getting an iCal which says "Calandar entry name" had invitees not recognized
-
Hi, I created oracle user in solaris . If I switch from root to oracle it's not asking the oracle user password and direcly going to $ prompt when I type the command who in $ promot its showing root , Why? $ who am i root ->here its should be show th