Powershell can be used for many things. In this case i would like to fetch data from SharePoint lists.
Powershell can work with data from
- a Database
- an Active Directory
- SharePoint via API
In my case i just use Powershell to get data from a webservice like the SharePoint webservice /_vti_bin/lists.asmx
This example was the basic for me to get data from a MS Dynamics CRM system. But to keep it simple i will stay in SharePoint
At first i define a variable for the webservice URL and then i create the proxy. With the proxy i can access the methods of the webservice.
#URL for the Webservice $URI = "http://server/sites/sitecollection/_vti_bin/lists.asmx?WSDL" #Call a proxy $proxy = New-WebServiceProxy -Uri $URI -Class ILSWebservice -Namespace ILS -UseDefaultCredential #Get the list $list = $proxy.GetList('Documents') #Display the list title $list.Title
The Namespace and class doesn’t matter at this time. Just name it like you want
How cool is that?
So in the next steps, you can use these webservices to update SharePoint Items or do anything else. You don’t need to run the Powershell on the SharePoint Server itself, so your possibilities are huge.
Happy Powershelling 🙂The article or information provided here represents completely my own personal view & thought. It is recommended to test the content or scripts of the site in the lab, before making use in the production environment & use it completely at your own risk. The articles, scripts, suggestions or tricks published on the site are provided AS-IS with no warranties or guarantees and confers no rights.