add-adpermission using import-clixml error

Hello,

I am attempting to use export-clixml to store adpermissions using:

get-adpermission -identity $adname |export-clixml C:\TEMP\$aduserid.xml

This successfully exports all adpermissions for an ad object to an xml file.  I am doing this so I can close powershell and open it up at a later date and reimport the saved ad permissions for certain users. 

To reimport the adpermissions I run the command:

import-clixml c:\TEMP\$aduserid.xml | add-adpermission -identity $adname

This returns the error: 

add-adpermission : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.

Is there anything I can do that allows me to add ad permissions using previously exported xml files of the user's get-adpermission?

If not, is there another option that would allow me to save the adpermission of a user, come back at a later time, and set the adpermission using the saved permissions?

Thank you!

CarlMez


July 21st, 2015 6:43pm

I would ask this question in Windows or PowerShell forum....

https://social.technet.microsoft.com/Forums/windowsserver/en-US/home

https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home

Free Windows Admin Tool Kit Click here and download it now
July 21st, 2015 7:21pm

Hi,

Whats the information you stored to this variable in the previous pipeline?

Try to use the same command to assign the value to the variable, then run the command to add AD permission.

Best Regards.

July 21st, 2015 11:19pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics