CLI power script to include the identification of domain information when crossing the fields

Hey all,.

I'm trying to get my script to run and export the CSV output in another field automatically without intervention. Problem is that I have to use UNC to join the other area, as soon as I did this, then I get their credentials. MyScript fails with connection failure: unknown username or bad password

Can anyone give me a tip on doing an I've tried everything and have pracatically me given an aneurysm in the process

The PowerShell would be to use the New-PSDrive cmdlet. It allows you to pass the credentials.

New-PSDrive-name filesystem MyDrive - PSProvider-root "\\server\share" - Credential $myCredential

Export-Csv-path MyDrive:\file.csv

Tags: VMware

Similar Questions

  • How do I run a script only if the field is not empty

    How do I run a script only if the field is not empty

    Well well, thanks to you, I had a full date on separate days, the months and the years in different areas. But now, I have a problem, as PDF has several fields calculated with script if you enter the date calculated by all other areas, which have separated and undefinied gives me does not want to put this to not always use this field. I tried to put one conditional if else but I sale. Esto, this is what I'm wearing

    var datesol = event.value;//declaramos the variable

    If (datesol = "") {}

    this.getField('yearsol').value = "";

    this.getField('monthsol').value = "";

    this.getField('daysol').value = ""}

    else {}

    var array_datesol = datesol.split("/"); / / separamos esa con date the split funcio

    this.getField('yearsol').value = array_datesol [2];

    this.getField('monthsol').value = array_datesol [1];

    this.getField('daysol').value = array_datesol [0];

    With what they do not separate them now.

    Help please

    As mentioned, you cannot use

    If (datesol = "")

    because that sets the value of datesol to «» (you will need to double for the comparison operator =)

    If you want to run code only if it is NOT empty, while it takes:

    If (datesol <> "")

  • Edit a script to reset the fields selectively a multiform document

    The script provided to clear forms selectively page-by-page in a multiform document.

    But the script is very limited because wants to change every page where a new page number for the variable is inserted "resetFieldsOnpage (n).

    In a document of 100 pages, it's a a nonsense task, involving several stages:

    1. go to the page
    2. Tap the clear
    3. right mouse /properties
    4. choose actions
    5. Select run a java script
    6. Modify the Java script
    7. now change the page number
    8. close

    It may be possible to have a real script assigned to the same field (duplicated in all pages) which allows that acrobat includes the used button is bound to a specific page and the clearing will only affect this one.

    Thank you.

    function resetFieldsOnPage (p) {}

    var fields = [];

    for (var i = 0; i < this.numFields; i ++) {}

    var f = this.getField (this.getNthFieldName (i));

    If (f == null) continue;

    If (f.page is p)

    Fields.push (f.Name);

    }

    this.resetForm (fields);

    }

    resetFieldsOnPage (0);

    Just call it like this:

    resetFieldsOnPage (event.target.page);

  • How can I customize the template of Contacts to include the fields of my choice?

    I have my contacts in an excel file and intend to import contacts into a CSV file. No problem. But Contacts model uses a lot of fields I don't need (such as Pager) and I see no way to customize more compared to what I need.  I want change, not the mapping of the fields to the options in the default template. In Contacts, in the view drop-down list, choose the folder to view the details. The selection becomes a column header and can be used as a filter. It seems to be more than 100 selections.  How to use these matach to a field in the Contact model? Example: 'Product name' is one of the details (column header) I choose, but there is no corresponding information in the Contact model, 'Product name' isn't one of the choices when mapping fields during import.

    Wrong forum.
    Ask here:
    http://answers.Microsoft.com/en-us/Office/Forum/Excel

  • Adobe Java Script to change the field of reading to write based on radio button selection

    I created a form the question asked is "Do we have a credit limit?" the user can select a Yes or not by using a radio button.  If the user selects Yes we do not have a credit limit that I want the text field "CreditLimitAmount" to change the read only entry.

    Here is my code, but it does not work, someone would be able to see what I'm doing wrong?

    GetField ("CLYes"). Value
    If {(event.target.value==="Off)"}
    f.ReadOnly = false;
    f.fillColor = color.white;

    } else {}

    f.ReadOnly = true;
    f.FillColor = Color.Gray;
    }

    You have it backwards. Use this code as your radio buttons script two MouseUp and remove the code that you have applied to the text field:

    var f = this.getField("CreditLimitAmount");
    if (event.target.value=="CLYes") {
        f.readonly = false;
        f.fillColor = color.white;
    } else {
        f.readonly = true;
        f.fillColor = color.gray;
    }
    
  • WLST Script to create the field of OSB with Oracle XE

    I installed oracle Service bus 10.3 with Oracle XE on a CentOS linux distribution. Everything went well. I created a default domain with the Wizard (so with Pointbase). Now, I want to go a little further. So I want to automatically create a domain OSB for Oracle XE. I used the following script (I borrowed from another thread ;-))):

    -----
    import sys

    Print "@ from the script...» »

    Try:
    domaintarget = "/ apps/bea/user_projects/domains/test2.
    domainUser = "weblogic.
    wl_home='/apps/BEA/wlserver_10.3'
    workshop_home='/apps/BEA/workshop_10.3'
    osb_home='/apps/BEA/osb_10.3'


    def configOraDB (dataSource):
    CD (DataSource)
    URL = "jdbc:oracle:thin:@localhost:1521:XE".
    Set ('URL', URL)
    Set('DriverName','oracle.) JDBC. OracleDriver')
    cmo.setPasswordEncrypted (domainUser)
    CD (' Properties/NO_NAME_0/Property/user')
    Set ('Value', domainUser)
    CD ('. /.. /.. /.. /.. /.. /.. / JdbcConnectionPoolParams/NO_NAME_0 ')
    cmo.setTestTableName ('dual')


    # Open a field template.
    readTemplate (wl_home + ' / common/templates/domains/wls.jar')

    CD (' Servers/AdminServer')
    together ('ListenPort', 7002)
    Set('ListenAddress','')


    CD('/')
    CD (' Security/base_domain/user/weblogic')
    cmo.setName ('weblogic')
    cmo.setPassword ('weblogic')
    setOption ('OverwriteDomain', 'true')
    writeDomain (domaintarget)
    closeTemplate()

    readDomain (domaintarget)


    addTemplate (workshop_home + ' / common/templates/applications/workshop_wl.jar')
    addTemplate (wl_home + ' / common/templates/applications/wls_webservice.jar')
    addTemplate (osb_home + ' / common/templates/applications/wlsb.jar')

    configOraDB('/JdbcSystemResources/wlsbjmsrpDataSource/JdbcResource/wlsbjmsrpDataSource/JdbcDriverParams/NO_NAME')
    configOraDB('/JdbcSystemResources/cgDataSource/JdbcResource/cgDataSource/JdbcDriverParams/NO_NAME')
    configOraDB('/JdbcSystemResources/cgDataSource-nonXA/JdbcResource/cgDataSource-nonXA/JdbcDriverParams/NO_NAME')



    updateDomain()
    closeDomain()


    except:
    dumpStack()
    Print "unexpected error:", sys.exc_info () [0]
    lift
    -----

    This creates a pretty empty field, as I have not yet created a real database. The command I found was

    loadDB ('10g ','wlsbjmsrpDataSource ')

    that will load the appropriate tables (of OSB/dbscripts /..)

    The problem is that I have no schema/user created in Oracle XE. So, I can manually create this but is not what I want to do. I also want to be scripted. So, how can I do this or is this not the way to go. You always manually create users on the database for three data sources (cgDataSource, wlsbjmsrpDatasrouce, cgDataSource-nonXA) before running a script to make a loadDB. Or do I run some kind of script create_user.sql or something.

    A second issue is that I can't find the scripts for the databases for cgDataSource and cgDataSource-nonXA data sources. They should be somewhere in workshop_10.3 but I can't find them. So, what is the problem here, I have to do a loadDB('10g','cgDataSource') or that eventually an error?

    My last question is I want to change the ALSB_DEBUGPORT (7 something) and debugging of the FMV of port (8453) in my script, how can I do this? I had another instance that already use these ports, so this won't work...

    My preference would be to invoke wslt by ant. This way Weblogic specific configurations can be addressed using WSLT and generic configurations (create DB users) can be done using ant.

    The files SQL to create tables required for the OSB are present in/MiddlewareHome/Oracle_OSB1/dbscripts/oracle. Try to run manually by using the Ant sql task. Create DB users is also possible using the same Ant SQL task http://ant.apache.org/manual/CoreTasks/sql.html.

    There are several ways you can do. I use http://ant.apache.org/manual/CoreTasks/replace.html as shown below in an Ant macro. Similarly, you can replace the ALSB_DEBUGPORT debug port and jvm debugging.

              
         



              
         


              
         


              
         


              
         


              
         


    Maury

  • Including the field indicator

    I have a similar following the requirment


    Select * from emp where deptno = 10

    List 3 lines

    I want to include a DEPT_IND indicator with values of "Y" or "n" for these 7 rows.
    DEPT_IND is set to 'Y' when the line returned by the above query has an enrty for the deptno = 20 condition in the emp table.


    How can I include in the query

    examples of data table.
    emp
    
    empno ename deptno
    121     xxx     10
    121     xxx     20
    123     yyy     10     
    124     zzz     10
    
    I should get the o/p as
    
    empno ename DEPT_IND
    121    xxx     Y        
    123    yyy     N
    124    zzz     N
    Thanks for your help.

    Hena.
    SELECT   e1.empno,
             e1.ename,
             NVL ( (SELECT   'Y'
                    FROM     emp e2
                    WHERE    e2.deptno = 20
                         AND e2.ename = e1.ename
                         AND e2.empno = e1.empno
                         AND ROWNUM = 1), 'N')
               dept_ind
    FROM     emp e1
    WHERE    e1.deptno = 10
    

    Published by: Beijing on August 5, 2009 14:25

    Published by: Beijing on August 5, 2009 14:26

  • Amount import the script based on the entity

    I have a data file of local currency with all my features in there. However, because of the way that SAP stores one of the currencies that I need several amounts for a single entity by 100. I have attached the script below in the field amount in the import format, but I'm not having any luck. I know there is not something which only escapes me on the StrEntity variable. Any help would be greatly appreciated.


    Function XAFcurrency (strField, strRecord)

    If StrEntity = "7771.

    XAFcurrency = StrField * 100

    On the other

    XAFcurrency - StrField

    End If
    End Function

    You must analyze the strRecord with the fParseString command or split command before testing the value of the entity.

    For example, your files contain 12 fields delimited by tabs and 10 is the field of the entity. You can then use the following:

    If DW. Utilities.fParseString (strRecord, 12, 10, vbTab) = "7771" Then
    XAFcurrency = StrField * 100
    On the other
    XAFcurrency = - StrField
    End If

  • Why the MAX aggregate function is used in SQL upon accession of the fields created in the designer?

    Of course Certified Developer, you can see the left join to include the fields in the SU_EXTENTION_DATA table. Why MAX is used when retrieving these values?

    ! Wont start-

    LEFT JOIN

    (SELECT

    REF_NO "REF."

    MAX (CASE WHEN EXTENSION_FIELD_REF = 500033 THEN VALUE_DATE END) "DOB",.

    MAX (CASE WHEN EXTENSION_FIELD_REF = VALUE_STRING END THEN 500034) "E_CONTACT."

    MAX (CASE WHEN EXTENSION_FIELD_REF = 500035 THEN VALUE_STRING END) "E_CONT_NO."

    MAX (CASE WHEN EXTENSION_FIELD_REF = 500036 THEN VALUE_TEXT END) "MED_HIST."

    MAX (CASE WHEN EXTENSION_FIELD_REF = 500037 THEN SELECT_TEXT END) 'PREF_CONTACT '.

    OF SU_EXTENSION_DATA

    LEFT JOIN SU_SELECT_VALUES ON

    SU_EXTENSION_DATA. VALUE_SELECT = SU_SELECT_VALUES. REF

    WHERE CORE_ENTITY = 5

    REF_NO GROUP) X ON AR_PERSON. REF = X.REF

    ! End custom-

    When you do you must include all the fields that have been selected as criteria for grouping the aggregation OR use false features like MAX (more likely it's easier way when the result field is expression).

  • Need help to create using the CLI power user ID

    Hello

    I am creating the ID using pslink.exe in CLI power, I get the error message or

    Server a command exit status 2
    use: useradd [u uid [-o]] [-g group] [-group g,...]
    [d home] [- s Shell] [-c review] [m [-model k]]
    [inactive f] [EI expire] [Pei passwd] [-M]. [-n]. [-r]. [- l] nam
    useradd-d [-g group] [b basis] [-s Shell]
    [inactive f] [EI expire]

    This is the script

    Get-VMHost | %{
    $User = "root".
    $Pswd = "xxxxxx".


    $plink = "C:\Progra~1\PuTTY\plink.exe".
    $plinkoptions = ""--v - lot - pw $Pswd ""
    $cmd1 = 'useradd u 10001 - G wheel s/bin/bash-d/home/xxxxx m Pei xxxxxx - c "xxxxxx" XXXXXX ".

    $remoteCommand = ""'+ $cmd1 + "'"
    $command = $plink + "" + $plinkoptions + "" + $User + '@' + $_.NAME + "" + $remoteCommand


    $msg = expression invoke-command $command

    }

    Help on this

    Why not use the New-VMHostAccount cmdlet? Something like:

    New-VMHostAccount-Id 1001 - password TopSecret-Description "user 1001' - UserAccount - AssignGroups - wheel GrantShellAccess.

  • Dock VB043AA (compatible with Elitebook 8470p) - including the power?

    Hello

    There are 2 docks compatible with the p 8470

    90 w (VB041AA) dockside

    a dock of 230w (VB043AA)

    I do not see the real differences when checking the plug:

    http://portal.tugraz.at/portal/page/portal/files/Zid/files/Datenblatt/computing/HP-docking.PDF

    Is it possible to use the power of 90w using the "230w" dock?

    Why is there a difference in power between 2 platforms?

    Thank you very much

    Hello

    230w power must allow the docking of a mobile workstation, these laptops are over powered and therefore need a power supply the higher power.

    230w docking station is required to manage this more load, although physically, it's the same as the 90w, it includes elements that are evaluated for the 230w.

    He is briefly mentioned in the specs of th

    «The HP 90 w Docking Station gives you a Smart adapter 90W high energy performance for your notebook PC.» HP 230W Docking Station gives you a Smart adapter 230W-saving in energy for your PC laptop or Mobile Workstation. These Smart adapters guard against fluctuations in power supply with built-in surge protection.

    You do not mix food because it can lead to an overload.

  • Script to include a background color change depends on the answer

    I previously got help from a user here to create a script that autopopulates field based on the options selected in two sets of radio buttons:

    var result = this.getField("Consequence").valueAsString;

    probability of var = this.getField("Likelihood").valueAsString;

    If (result == 'Negligible' & & probability == 'Rare') event.value = "Low";

    Else if (result == 'Negligible' & & probability == 'Unlikely') event.value = "Low";

    ElseIf (result == 'Negligible' & & probability == 'Moderate') event.value = "Low";

    Else if (result == 'Negligible' & & probability == 'Probably') event.value = "Low";

    ElseIf (result == 'Negligible' & & probability == "almost certain") event.value = "moderate."

    Else if (result == 'Minor' & & probability == 'Rare') event.value = "Low";

    Else if (result == 'Minor' & & probability == 'Unlikely') event.value = "Low";

    ElseIf (result == 'Minor' & & probability == 'Moderate') event.value = "moderate."

    ElseIf (result == 'Minor' & & probability == 'Probably') event.value = "moderate."

    Else if (result == 'Minor' & & probability == "almost certain") event.value = "high";

    Else if (result == 'Moderate' & & probability == 'Rare') event.value = "Low";

    ElseIf (result == 'Moderate' & & probability == 'Unlikely') event.value = "moderate."

    ElseIf (result == 'Moderate' & & probability == 'Moderate') event.value = "high";

    ElseIf (result == 'Moderate' & & probability == 'Probably') event.value = "high";

    Else if (result == 'Moderate' & & probability == "almost certain") event.value = "critical";

    Else if (result == "Major" & & probability == 'Rare') event.value = "Low";

    ElseIf (result == "Major" & & probability == 'Unlikely') event.value = "moderate."

    ElseIf (result == "Major" & & probability == 'Moderate') event.value = "high";

    Else if (result == "Major" & & probability == 'Probably') event.value = "critical";

    ElseIf (result == "Major" & & probability == "almost certain") event.value = "Extreme";

    ElseIf (result == "Catastrophic" & & probability == 'Rare') event.value = "moderate."

    Else if (result == "Catastrophic" & & probability == 'Unlikely') event.value = "high";

    Else if (result == "Catastrophic" & & probability == "Moderate") event.value = "critical";

    ElseIf (result == "Catastrophic" & & probability == 'Probably') event.value = "Extreme";

    ElseIf (result == "Catastrophic" & & probability == "almost certain") event.value = "Extreme";

    etc.

    else event.value = "";

    I wonder if its possible to have the color of the field that uses the script above, change based on the input. For example if the response is weak; make the background color green. If its moderate, make orange etc. ?

    I know it of asking a big but thought I would check.

    Thanks in advance.

    Of course, it is possible. Add at the end of your code:

    if (event.value=="Low") event.target.fillColor = color.green;
    else if (event.value=="Moderate") event.target.fillColor = ["RGB", 1, 0.5, 0]; // = Orange
    else if (event.value=="High") event.target.fillColor = color.red;
    // etc.
    else event.target.fillColor = color.white;
    
  • inventory including the last report date of extinction

    Hello

    I'm new to power cli (about a week to try) and am trying to run a powercli script that will give me a list of off the virtual computer with specific information, including the date, it has been turned off. My script looks like this:

    @"
    ===============================================================================
    Title: vminventory.ps1
    Description: Export VM Information for vCenter in one. CSV file for import into what anyone
    Use:.\vminventory.ps1
    Date: 15/10/2012
    ===============================================================================
    "@
    # Get virtual center to connect to:
    $VCServerName = Read-Host "What is the name of Virtual Center?"
    $ExportFilePath = Read-Host "where you want to export the data?
    $VC = to connect-VIServer $VCServerName
    $Report = @)
    #$VMs = get-file $VMFolder | Get - VM
    $VMs = get - vm | WHERE-object {$_.powerstate - eq "poweredoff"}
    $Datastores = get-Datastore. Select Name, Id
    $VMHosts = get-VMHost | Select Name, Parent
    # Get turned off from the time of the event:
    {ForEach ($VM to $VMs)
    Get-VIEvent-body $VM - MaxSamples ([int]: MaxValue) | where {$_-is [VMware.Vim.VmPoweredOffEvent]} |
    Group-object - property {$_.} Vm.Name} | %{
    $lastPO = $_. Group | Tri-objet-property Createduserid-descending | Select - 1 first | Select Createduserid - ExpandProperty
    New-object PSObject-property @ {}
    VM = $_. Group [0]. Vm.Name
    "The last Poweroff" = $lastPO
    }
    }
    $VMView = $VM | Get-View
    $VMInfo = {} | Select VMName Powerstate, OS, IPAddress, ToolsStatus, host, Cluster, data store, NumCPU, MemMb, DiskGb, SSGOwner, BUSowner, PowerOFF, Note
    $VMInfo.VMName = $vm.name
    $VMInfo.Powerstate = $vm. PowerState
    $VMInfo.OS = $vm. Guest.OSFullName
    $VMInfo.IPAddress = $vm. Guest.IPAddress [0]
    $VMInfo.ToolsStatus = $VMView.Guest.ToolsStatus
    $VMInfo.Host = $vm.host.name
    $VMInfo.Cluster = $vm.host.Parent.Name
    $VMInfo.Datastore = ($Datastores | where {$_.}) ID-match (($vmview.)) Data store | Select - first 1) | Select the value). Value} | Select name). Name
    $VMInfo.NumCPU = $vm. NumCPU
    $VMInfo.MemMb = [math]: round (($vm.)) (MemoryMB), 2)
    $VMInfo.DiskGb = [math]: Round ((($vm.)) Hard drives | Measure-Object-CapacityKB property-sum). Summary * 1 k / 1 GB), 2)
    $VMInfo.PowerOFF = $lastPO
    $VMInfo.SSGOwner = ($vm |) Get-Annotation - CustomAttribute "SSG system owner"). Value
    $VMInfo.BUSowner = ($vm |) Get-Annotation - CustomAttribute "Business system owner"). Value
    $VMInfo.Note = $vm. Notes
    $Report += $VMInfo
    }
    $Report = $Report | Sort-Object VMName
    IF ($Report - don't ' ') {}
    $report | Export-Csv $ExportFilePath - NoTypeInformation
    }
    $VC = disconnect VIServer $VCServerName - confirm: $False

    I can't get to browse and read the power of the events in the log of the events on the virtual machine?  Someone at - it ideas?

    No, my mistake. Which should have been $lastPO.VM.VM.

    I've corrected the above code

    Update: just noticed another typo, it's fixed

  • Looking for a Script to check the current status of the VM tools based on resource pool (customer name)

    Hi all and

    LucD The champion!

    I'm looking for a power-cli script to verify the State of VM-tools of all the virtual machines in the cluster multi environment. Could you please help me on this. It would be really appreciated.

    Thank you. in advance.

    Concerning

    Nauman

    Try like this

    $report = @)

    {foreach ($cluster Get-cluster)

    foreach ($rp in Get-ResourcePool-location $cluster) {}

    foreach ($vm in (Get-VM-location the $rp)) {}

    $report += get-disk hard - VM $vm |

    Select @{N = "Cluster"; E = {$cluster. Name}},

    @{N = "ResourcePool"; E = {$rp. Name}},

    @{N = "VM"; E = {$vm. Name}},

    @{N = 'Tools status'; E = {$vm. ExtensionData.Guest.ToolsStatus}},

    @{N = 'HD'; E={$_. Name}},

    @{N = "Datastore"; E={($_. Filename.Split(']') [0]). TrimStart('[')}},

    @{N = 'Filename'; E={($_. Filename.Split('_') [1]). "Split('/') [0]}},"

    @{N = 'Path VMDK'; E={$_. File name}}.

    @{N = "Format"; E={$_. StorageFormat}},

    @{N = ' Type'; E={$_. DiskType}},

    @{N = "CapacityGB"; E={$_. CapacityGB}}

    }

    }

    }

    $report | Export Csv C:\temp\report.csv - NoTypeInformation - UseCulture

  • How to create a new power plan that includes key backlit stop?

    I can't find any setting in the advanced power properties dialog box. Toshiba has provided a power eco plan. It's OK for me except the pilot. So I tried to create a power plan as eco with night light 1 hour not 5 minutes.
    However, this plan does not backlight key off.

    How can I create a new power plan that includes key backlit stop?

    Have you tried to change the power management Windows including power advanced for certain power plan options?
    For example, you can use balanced plan or standby power, change it and that s it.

Maybe you are looking for

  • HP Pavilion p7 - 1227c: GDDR5 graphics compatibility question card XFX Radeon R9 380 4GB with HP Pavilion p7 - 127c?

    I bought this Radeon R9 380 4 GB from Ebay and installed it in my computer, but it won't work. Turn fans of the graphics card but the PC screen remains black. I contacted the seller who said that the video card has been tested prior to shipment and t

  • initialization

    SalamHello I am looking how to do program init or reset each midnight IE that I take every day as example and I want this time 00:00:00, 000, all indicators will be boot... AND THANK YOU

  • Move the taskbar... How?

    The taskbar with the Start button on it is located to the right of my screen.  It is usually at the bottom.  How can I move it back?  Please help me?  Thank you.

  • CD player & flash card reader does not

    When I place a CD in the drive, it allows to open automatically, now I have to go on my computer, and then open them, also when I insert my Flash card in my pc, then open my computer it doesn't show even the disc unless I have uninstall the USB host

  • Advertising WebWorks service works in ripple?

    I am trying to add a banner to my request of WebWorks for OS 6/7 phones.  I think I have my correct code in my app, but when I test in Wellington I ever see all ads appear.  This feature cannot be tested in ripple?  My code is as follows: config. XML