0

I'm new to SharePoint. We have a list of AD objects that we are looking for owners. We are using SharePoint to store the data and send email out to people to accept or deny ownership to the AD object (service acct/groups).

I want to take this data and update an AD attribute with the owner's name and ID using PowerShell. Does anyone know how I can do this? I am not the sharePoint admin. I simple own the data list and have access to export to an excel file. But I would like to automate the process.

Thank you.

3
  • So you just want to loop through the contents of the list and use that to update your AD objects? I'm assuming you're matching them by user logon name. Commented Jun 15, 2015 at 18:22
  • Yes that is correct. Commented Jun 17, 2015 at 20:40
  • I would like to run a script to automatically export the data into a csv file on a file location. Then use that file to update a custom AD attribute. Commented Jun 17, 2015 at 20:43

1 Answer 1

0

This PowerShell script will export the list into a desired CSV file.

        Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction 
        SilentlyContinue -WarningAction SilentlyContinue | Out-Null 

        $url = "<site url>"
        $listName = "<list name>"
        $path ="c:\Columns.csv"

        $web = Get-SPWeb $url
        $list = $web.Lists.TryGetList($listName)
        $list.ContentTypes | % { $_.FieldLinks } | select Name |  Export-Csv -path $path
2
  • I'm running powershell 2.0. Do I need to upgrade to 3.0 and install SharePoint 2013 with the SharePoint management shell? Is there anyway to just install the SharePoint management shell on my server? If not will sharepoint online management shell allow me to do what I'm trying to accomplish here? Commented Jun 18, 2015 at 19:14
  • You need to install the SharePoint management shell. Here are the instructions. technet.microsoft.com/en-us/library/ee806878.aspx Commented Jun 19, 2015 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.