In this installment its time to look at the various cmdlets that have to do with features. of course you can look at the UI to do this but its much, much easier to do this powershell and dare I say more fun.
Now keep in mind that this only relatedFarm Level features, I will cover sandbox solutions and features next!Listing features on farm, site collection and site
The main cmdlet used within
, such as650) this.width=650; "title=" 33.png "alt=" Wkiom1baba-wxfsbaad9udekequ532.png "src=" http://s1.51cto.com/wyfs02/M00/ 7a/da/wkiom1baba-wxfsbaad9udekequ532.png "/>We look at the information that corresponds to each property of the command itself, such as650) this.width=650; "title=" 44.png "alt=" Wkiol1babr6sew80aaeattysncm247.png "src=" http://s3.51cto.com/wyfs02/M01/ 7a/da/wkiol1babr6sew80aaeattysncm247.png "/>Let's look at the definition of this property, which has a lot of parameter
PowerShell as much as we do. Next month, we are have a script-club type of meeting; We encourage people to show up with the Windows PowerShell scripts they is working on, so it'll be a show-and-tell type of meeting.Use Sort-object to organize outputAnyway, after the user group meeting, if we were all standing around, one of the attendees came up to me and asked me in What order Windows
method to create a lot of lists in a row, we will repeatedly get the lists data of the website, which will increase the memory consumption, if the call once and save in a variable, so that only need to get a lists of the data, and can be reused.
To update a SharePoint list by using PowerShell
Let's modify the list we just created, and first we need to use the
Creating Lists in SharePoint 2010
One of the most powerful features of SharePoint from an end user's perspective is the degree of creating and customizing lists, views, and items. lists store data. sharePoint 2010 nodes des a large number of list templates that can be used as they are or as a starting point to tailor them to fulfill your specific business requirements. lists have a set of configurable settings that apply to all lists, as well as custo
lists data will increase the memory consumption. If it is called once and saved in a variable, you only need to obtain the lists data once and can reuse it.
Update Sharepoint list using powershell
Next, let's modify the list we just created. First, we need to use the getlists () method to obtain this list.
PS> $ splis
The code is as follows (save to a local PS1 file, right-click Run with PowerShell):add-PSSnapin microsoft.sharepoint.powershellfunction Createsplistitems () {$sites= get-SPSiteif($sites. Count-eq0) {Write-warning"There is no site available."Createsplistitems}Else{Write-host"Choose the site:"-Foregroundcolor Yellow for($i =0; $i-lt $sites. Count; $i + +) {$tip="["+ $i +"]."+$sites [$i].url Write-Host $tip} $choice= Read-host"Enter the number before"$ti
This article describes that when customizing the PowerShell function, there is a $psboundparameters variable to get to the input parameter list. Getting the input parameter list is a great help for our functional debugging.
When we execute a function, we can use the value of the input parameters, but I am in the PowerShell
-warning $Error [0]. Exception.Message}}Not a professional code farmers, write code is not professional ha ~ Make it possible to use the line, because the script will run longer, the international version of the words may take more than half an hour, so add some progress bar to let users have a good understanding of the progress of the operation. The state of operation is almost like this.Finally there is a file on the desktop, this is the list of the
1. Download the SharePoint Online Client components SDK here in https://www.microsoft.com/en-us/download/details.aspx?id=42038 and install it.2. Download the SharePoint management module written by the foreign God https://gallery.technet.microsoft.com/office/SharePoint-Module-for-5ecbbcf0 here, unzip it and put it in C : \windows\system32\windowspowershell\v1.0\modules\mysharepoint folder Inside, you can also in C:\Windows\System32\WindowsPowerShell \v1.0\profile.ps1 this file into the Import-mo
Applicable: Exchange 2010Get-activesyncdeviceclass:exchange Online Helphttps://technet.microsoft.com/zh-cn/library/ff731393 (v=exchg.150). aspxThe following command filters the specific properties and then exports the results to a TXT file.650) this.width=650; "title=" C5c855a6225244bc96e6cfa4e7434dd8 "style=" border-top:0px;border-right:0px; border-bottom:0px;border-left:0px; "border=" 0 "alt=" c5c855a6225244bc96e6cfa4e7434dd8 "src=" http://s3.51cto.com/ Wyfs02/m01/78/15/wkiom1z1v4tistfwaaa1e_4
WMI is the abbreviation for Windows Management specification, which contains a lot of system hardware and software information. Windows user information can also be obtained through WMI objects. PowerShell provides access to WMI, very handy and powerful-this is the cmdlet get-wmiobject.
Get a list of all Windows users:Get-wmiobject-class Win32_UserAccount or Get-wmiobject.
Copy Code code as follows:
we can use Get-content to load any script into the variable, and use this load variable into the code above.
Support 3.0 and beyond
In the development process, often need to use environment variables (such as the current computer name, login username, PATH environment variables, etc.), then how to know in the PowerShell of the environment variables? And how do you get the value of the specified environment variable?
. Userprofile|where-object{$_. name-eq "Personalspace" } $Url = $Prop. values[0]. value#if "Personalspace" (whichwe ' vecopiedto $Url) exists, logittoourfile...if ($URL) {$Url |Out-File $LogFile - Append-force}#andnowwecheckthenextprofilethesame way $UserProfileResult = $UserProfileService. GeTuserprofilebyindex ($UserProfileResult. NextValue) $i ++}write-host "done!" You can see that there are some content that needs to be modified, such as the admin URL, account password, save location, etc.,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.