Get-QADComputer fails if run PowerShell script through Orchestrator workflow

I use the "Get-QADComputer" cmdlet in my .ps1 script that is supposed to run via Orchestrator.  I have several PowerShell scripts started by Orchestrator and run on a host windows without any problem.  For this script, I have these 2 commands and still error.  The script does not error when run locally.

Add-PSSnapin Quest.ActiveRoles.ADManagement - ErrorAction SilentlyContinue

$Computer = get-QADComputer-identity "server01" | where {$_.name - eq "server01"}

In troubleshooting, I ran Get-PSSnapin and can see that the snap for AD is loaded successfully.  I tried Connect-QADService and who also gives the same error, although it works very well on place.

I use vCO 5.1.1. device.   On the hosts Windows where are the scripts PowerShell, the AD snap is version 1.6.0.2683.

Here is the error in the logs Orchestrator...

PowerShellInvocationError: Errors found during execution of script

System.Runtime.InteropServices.COMException (0x8007054B): the specified domain does not exist or could not be contacted.

at Interop.ActiveDs.IADsOpenDSObject.OpenDSObject (String lpszUserName, String lpszPassword, String lpszDNName, Int32 lnReserved)

to Quest.ActiveRoles.ArsPowerShellSnapIn.DirectoryAccess.AdsiDirectory.NativeBind (adsPath String, AuthenticationTypes bindFlags)

at Quest.ActiveRoles.ArsPowerShellSnapIn.DirectoryAccess.AdsiDirectory.BindToObject (String dn)

at Quest.ActiveRoles.ArsPowerShellSnapIn.DirectoryAccess.ConnectorFactory.Create (String serverName, user String, SecureString password, type of ConnectorType)

to Quest.ActiveRoles.ArsPowerShellSnapIn.Powershell.Cmdlets.ConnectionAwareCmdlet.EstablishConnection (ConnectionProperties connectionProperties)

at Quest.ActiveRoles.ArsPowerShellSnapIn.Powershell.Cmdlets.ConnectionAwareCmdlet.GetContainer)

at Quest.ActiveRoles.ArsPowerShellSnapIn.Powershell.Cmdlets.GetUserCmdlet.BeginProcessing)

at System.Management.Automation.Cmdlet.DoBeginProcessing)

at System.Management.Automation.CommandProcessorBase.DoBegin)

(Name of the dynamic Script Module: invokeScript #14)

Thanks for the info.  I use the workflow "Invoke an external script" to run many of my host admin PowerShell scripts.  It is easier for me to keep all .ps1 files in one place and not import them into Orchestrator.  The article prompted me to switch my connection to host basic Powershell to Kerberos.  To do this, I had to update /etc/krb5.conf on the device of the vCO.  I've referenced VMware KB2036986 to work around the problem "unable to get kdc for the Kingdom.  This issue was mainly because we couldn't have krb5 configured previously.

Now, I got a different error during execution of the workflow after bouncing vCO.

System.NullReferenceException: Object Reference not set to an instance of an object.

Has pointed out me the need to first make the connection AD.  He has not worked before without Kerberos authentication.  Once I added these lines of code, Get-QADComputer finally worked without error!   Thanks for the help.

$pass = ConvertTo-SecureString - AsPlainText-Force - String "password".

Connect-QADService - "example.com\serviceaccount" ConnectionAccount - ConnectionPassword $pass

$Computer = get-QADComputer-identity "server01" | where {$_.name - eq "server01"}

Disconnect-QADService

Tags: VMware

Similar Questions

  • Struggling to run Powershell scripts / commands

    Hi all!

    I'm fighting to get the Powershell vCO workflow.  I think I missed something really obvious, but I can't see it...

    I did the set Kerberos in place on the line of my vCO 5.5.2 machine.  I added a Powershell v2 host using VMWare provided Powershell 1.0.4 workflows plugin install, Kerberos authentication and using a shared account (mine, I know that I am an admin on Windows Server).  I assured the Kerberos authentication and unencrypted traffic is accepted on the Powershell host.  If I validate the object created at the CVO, he says it's fine.

    When I come to run another VMware provided workflow, I get responses to error because the workflow doesn't seem to be properly trained, or I get a null response.  When I run a workflow, I can see my account by logging in the Windows Server 2008 security log, so I'm pretty confident that the basic connection and portions of Kerberos are all ok.

    I just tried to simplify a VMware provided workflow, to make it as a possible base (code below).  I always get a Null response.  Anyone have any ideas why?  Or did someone is able to provide the code for a very simple Powershell-based workflow that they know works so I can test it on my set up?

    The VMWare-based simple powershell script provided one to get the contents of some directories and the values that I use - it returns null:

    the hostentry, type: PowerShell:PowerShellHost, value: < myPowershellHostSelectedFromPluginManually >

    Directoryentry, type: String, value: I manually enter $home.  Or C:.  Or C:\Windows.  Or any other directory I know there is that my user account has no light problem.

    output of the result, type: string, value: regardless of the ("DIR" + directory) output >

    var Sess;

    connect to the host

    Sess = host.openSession)

    Send the command in powershell

    sess.addCommandFromString ("dir" + directory)

    invoke the command

    invResult = sess.invokePipeline ();

    get the result

    Result = invResult.getResults)

    Send to open a session

    System.log ("Result is" + result)

    Thank you very much in advance!

    And there we go...  Who sets: powershell.exe wasn't in the path of the Windows host!

    Thanks for the help everyone, especially igaydajiev for giving me the pointer of the final to my answer!

  • Running Powershell script with ESXCLI commands via a scheduled task in Windows 2012 does not work.

    I'm trying to run a powershell script of a scheduled task in Windows 2012. The script calls the commands ESXCLI and ends with success (exporting to a CSV file) but the file has no data inside.  If I run the script manually without the scheduled task file has all the I expect to exit.

    I wonder if there is a framework with Powershell or a PSSnapin I need to add to the script for it to run via a scheduled task.  Has anyone done this before with the ESXCLI commands?

    panhvr - you may to something.  The process account that I use to run this script has only read-only access in vCenter.  I logged on the server I am running these reports with the process ID and tried to run the script.  He gave me errors indicating permission to perform the operations of esxcli was denied.

    I think we found the culprit!  I'll have this process ID in vCenter rights upward.

    Thank you all!

  • Running a script powershell in a workflow

    Hi all

    Everyone was able to integrate a simle powershell script from a workflow job. Try to get a custom powershell script to be run from a workflow. There are a few specific elements of application checks the script. I hope that I can plan this workflow at a time affecting the operation.

    Has anyone seen any documentation on the development of workflows.

    Thanks advance.

    Please check thread

  • Cannot run the script generated with export Clip.

    I use AE CS6 and FCPX 10.0.7. I have imported the images in this way successfully before and have not changed or updated either of these programs since. Exporter of clip is up to date.

    Today, I created an XML of my calendar and trying to run the script generated from it, I get the error 'cannot run the script on line 22. WHEREAS"}

    I opened to the top of the script and 22 bed line editor ' comp [0] = {name: "Scenes of Kyle", w: 1920, h:1080, pasp:1.0000, hard: 39.7063, fps:23.9760, departure: 0.00001};

    Any help would be appreciated.

    The default is here:

    name: "Scenes of Kyle.

    For a shell script that reads as

    Kyle, scenes of s

    or be interpreted as noise and move the successive data so it would be interpreted wrongly. This is simply sloppy programming. It will have to be properly "escaped" to avoid the error:

    "Scenes of Kyle\".

    Contact the creator to fix his script and for the time being to use folder names that go without apostrophes...

    Mylenium

  • Run the powershell script in Workflow VCO

    Hi guys,.

    I'm pretty new to VCO and I am facing difficulties to get what I want. For you, this will be a Basic... but here's my question:

    I have a WF that I use in the WFStubmachineprovisionning that can generate me a name of virtual machine based on the selection of the user while he asked for a virtual computer in the VRA.

    The VM provisionned name looks like this: W203PKLXXX and I need to replace the XXX with a number that is available on the network.

    To do this, I need to query the DNS to see if there is, if not, 002 001... And so on... until an available and I send the full name of the virtual machine to the WF Stubprovisionning.

    This my first try to interact between VCO and a Powershell script. I can run script PS on my host configured, but do not know how to send variables to the custom WF that generates the name of the script of PS and send the name of VM from the script of the PS to the next step.

    Can someone give me a sample of variable to manage? I can't find anything on the net

    Just to tell you that I managed.

    the PS has returned an XML object, not a string. I had to use the method getxml() javascript property, and parse the string to get the value I need

    I also had to blind correctly (getxml) entry and exit (PS)

    If needed I can send you a few screenshoot

  • PowerShell script to get allocated funds and the memory used

    I'm trying to run a script powershell against a VC.  The purpose of the script is to get a table which shows the name, powerstate, allocated RAM, RAM, VC and VCL for each virtual computer.  What is the command to get the ram used?

    So, I started with:

    Connect-VIServer-server-name username-password password

    Get - VM | Select Name, Description, PowerState, MemoryGB | Export-csv-path "C:\VMInventory\Memory.csv" - NoTypeInformation

    Try this:

    Get - VM | Select Name, Description, PowerState, MemoryGB, @{n = "HostMemoryUsage"; e = {$_.}} ExtensionData.Summary.QuickStats.HostMemoryUsage}}

    Which should return the same value as the 'consumed host memory"displayed in the client vSphere (in MB).

  • Run the cmd PowerShell script

    Hello

    I am trying to run a powershell script from a file cmd with the snap of VMware has added. Here's what I'm trying to run:

    PowerShell.exe - noexit Add-PSSnapin VMware.VimAutomation.Core | k:\work\DeployVM.ps1

    He adds the snap, and then launches the ps1 in Notepad, which is obviously not what I'm after. I'm sure it's something simple I'm missing, but I can't get it. The reason why I want to run it this way is to associate with a button, vb, I've sorted everything else, just this last piece, I need to finish.

    See you soon,.

    Josh

    If there is a reason that you do not add the Add-PSSnapin VMware.VimAutomation.Core as the first line of your script, then you can run it as below:

    C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe - PSConsoleFile "C:\Program Files\VMware\Infrastructure\VIToolkitForWindows\vim.psc1" "& C:\MyScript.ps1 '"

    If you found this information useful, please consider the allocation of points for correct or helpful.

    Alan Renouf

    http://Virtu-al.NET

  • run a package through shell script

    Hi trying to run a package through shell script.
    But it is failling. Some may point out why?

    Here is the code im with


    ==================

    sqlplus user/pwd s < < EOF
    coil file.log

    START the user. PKG_Name.RUN_job;
    commit; END;
    spool off

    output
    EXPRESSIONS OF FOLKLORE

    ===========================


    I am able to run using the code below Toad.

    'BEGIN user. PKG_Name.RUN_job;
    commit; END; »

    What error do you get? Use
    sqlplus user/pwd s<>
    coil file.log
    START the user. PKG_Name.RUN_job;
    commit; END;
    /
    spool off
    output
    EXPRESSIONS OF FOLKLORE

    Kind regards.

  • Why I constantly get a message that says... "Stop running this script?"

    I constantly get a pop of message asking me if I want to "stop running this script"... a script on this page slows down Internet Explorer runs slowly. It happens on Facebook, no matter what I do, be it games or on the FB homepage.

    Follow this article http://support.microsoft.com/kb/175500

    Kind regards

  • Planning and running my script powershell crashed Windows 7

    Hi all

    I created a powershell script that works perfectly when I run it using powershell. Just, it reads XML files and email some information on their part. But as soon as I have this schedule using the Windows Task Scheduler and run it, it blocks the windows. First of all, trying to open the Task Scheduler, after planning script, it give error, the Task Scheduler service is not available. Then I rebooted my system, and windows starts in recovery mode. I even tried windows recovery to a point recorded earlier, but also, that did not help. My BUSINESS team had to redeploy full Windows 7 on my system. I already tried this on two different systems, both with Windows 7 Professional and it crashes in the same way.

    Please help me understand what I am doing wrong.

    I don't know how to download my forum script, please let me know if any of you wish to have a look, and I'll send my code.

    Thank you

    Vittoz

    _______@____.com

    Hello Ashish,

    Thanks for posting your question on the Microsoft community.

    This question fits better to the developers on MSDN forums.

    I suggest you to ask your question on the MSDN forums.

    MSDN forum
    https://social.msdn.Microsoft.com/forums/en-us/home?category=windowsdesktopdev

    Thank you

  • Newbie question - tide may run a remote PowerShell script or BAT file?

    My first post.  I am new to raz, but I've had experience with other planners.

    I have a PowerShell script that must be run on a remote computer.  All the script needs software is installed on this computer.

    In addition, I need the script runs under a service account.  Is it possible and if yes, how can I go about it?

    This work will be be launched manually whenever this is necessary.

    Sure. There are some screenshots. A variable one, I used for the location of the folder on the server of tide (not required but I use a lot of scripts). One for the command of tide itself. The last one is the script runs remotely on windows work. Let me know if they don't make sense.

  • Had to reinstall Adobe Acrobat Pro on new PC because the former has failed - now I get incorrect serial number and cannot get the program to run

    One of my PCs is failed.  Had me hard drive replaced.  Now cannot get Adobe Acrobat to run - continues to give me the serial number incorrect message.  Cannot get someone via live chat.  Does that keep me running in a loop to get more information, again and again.  Help/support stinks.  I just want to know if I can get a correct serial number

    Hey jat0,

    You will have to contact or team contact customer support on Monday, they will be able to check the serial key & help you after this fixed number.

    Kind regards
    Nicos

  • a way to run a powershell script?

    Y at - it another way to configure a script to be able to run by either double clicking on it or other means other than having opened powercli and goes the script and it works.

    It is not the best way to do it, but to help people not use powercli it will help running. The script that I know is very well to run... we are running win2k8 if it matters

    You can create a shortcut and under properties make it a race of PowerShell.exe.

    You pass as an argument to the PowerShell script runs.

    In the script, you ensure that the pssnapin PowerCLI is loaded.

    For example, the target of the shortcut can be

    %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe-fichier 'MyScript.ps1.

    You add in MyScript.ps1

    Add-PSSnapin VMware.VimAutomation.Core

    before that the script uses a PowerCLI cmdlet.

  • How to run the powershell script of command with several parameters

    Is there a way to run a powershell script from the dialog box run with several parameters? In addition, the path to the script contains spaces, for example, c:\powershell scripts\script.ps1.

    Take a look at http://www.powershell.nu/2009/12/16/running-scripts-with-arguments-in-powershell/ which explains how to pass arguments to a script.

    André

Maybe you are looking for

  • Breath app

    Is it possible to cut this app?  I don't want to bother me all the time. I put the reminder at 7, but it's not long enough.  I don't want the App at all can remove or disable it?

  • Do not disturb - trouble Me when the phone is locked

    My phone is locked after 1 minute when not in use by my compant police.  How can I get my iPhone6 to ring when a call comes in and the phone is locked? Thank you.

  • How can I use my last $ 0.43 I my account so I can move us to a UK address and acco

    I moved to the United States, to the United Kingdom. I need to change the country and address and pay the account. I can't have $0.43 balance and need to clear it before I change anything. What can I do to clear this account. I now live in the United

  • Profile pictures

    My profile for contact photos does not show all I have is their username. Can someone help me to be able to take pictures to show too: happy:... Thank you

  • Factory reset loading failed Windows 7

    I have tried factory reset my netbook, but I get a window saying "Windows must reset" I have reset it. Then he goes back to the implementation of services of another window pops up saying "Windows encounter a problem" whenever I turn on my netbook. I