0 votes

Testing script located here https://www.adaxes.com/script-repository/export-data-from-onedrive-s568.htm

$tenantDN not Null

Throwing Error:

You cannot call a method on a null-valued expression. At line:15 char:1

  • $tenant = $Context.BindToObjectByDN($tenantDN)
  • 
      + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : InvokeMethodOnNull
by (480 points)

1 Answer

0 votes
by (298k points)

Hello Derek,

Do we understand correctly that you are executing the script in Windows PowerShell? The thing is that the script uses the built-in Adaxes variable $Context and thus can only be executed in a Business Rule, Custom Command or Scheduled Task. Also, please, make sure that the user for which the script is executed has an associated Microsoft 365 (former Office 365) tenant registered in Adaxes. For details, have a look at step 8 of the following tutorial: https://www.adaxes.com/tutorials_ActiveDirectoryManagement_ManageAndAutomateOffice365.htm#collapse1.

0

Verified Step 8. Alxo, as far as powershell, if i edit the script and view resolved value references value and copy that into PS, shouldn't i be able to test / run the script? That's how i am running it in PS.

0

Hello Derek,

Sorry for the confusion, but we are not sure what exactly you mean. Could you, please, post here or send us (support[at]adaxes.com) the exact script you are executing in Windows PowerShell?

0

i was able to get it working. it was a space that had to be removed in the URL.

Related questions

0 votes
1 answer

This is what I need to accomplish. Day one, I perform an export of the following four attributes for all Users in AD - DN, employeeID, telephoneNumber, location. Day 2, ... in which one of them has changed. It possible to achieve this using a scheduled task?

asked Mar 23, 2015 by sbanks (270 points)
0 votes
1 answer

how to automatically grant a user's manager access to their network drive and onedrive during a user's deprovisioning. I don't want to manually grant access to the ... -prem file server and onedrive. Can this be incorporated in the user deprovisioning script?

asked Jan 28 by Fausat (20 points)
0 votes
1 answer

Looking for a script (unless there is a built in way, which I don't think there is) to grant User A full access to User B's OneDrive

asked Dec 16, 2024 by msheppard (720 points)
0 votes
1 answer

In this case the working example would be that the user would need to add a new title into a list of titles in the title property pattern

asked Dec 13, 2024 by msheppard (720 points)
0 votes
1 answer

For context, up until now, we had a business rule in place stopping accounts from being created for users with the same name e.g. Jacob Smith and Jacob Smith. This business ... , or how to, if possible, remove this. Any help would be most appreciated! Thanks

asked Oct 22, 2024 by Charlie.Evans (70 points)
3,628 questions
3,315 answers
8,392 comments
548,728 users