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.

  • 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. – jpollar Jun 15 '15 at 18:22
  • Yes that is correct. – Nat Jun 17 '15 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. – Nat Jun 17 '15 at 20:43
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
| improve this answer | |
  • 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? – Nat Jun 18 '15 at 19:14
  • You need to install the SharePoint management shell. Here are the instructions. technet.microsoft.com/en-us/library/ee806878.aspx – jpollar Jun 19 '15 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.