store the password encrypted for PowerShell scripts

Is there a way to store the password for the Commect-VIServer cmdlet in a file? I tried to use the ConvertTo-SecureString cmdlet, but failed to operate.

$vpass = ConvertTo-SecureString (Get-Content C:\scripts\vpassword.txt)
SE connect-VIServer-Server vc.domain.com - protocol https-user-word past $vpass

Thank you

Toad

You are missing a few steps.

You have created the file in this manner provided

$MyPswd = "xyz1234"
ConvertTo-SecureString $MyPswd -AsPlainText -Force | ` ConvertFrom-SecureString | Out-File -FilePath "C:\pass.txt"

You can convert like this

$pswdSec = Get-Content "C:\pass.txt" | ConvertTo-SecureString $bPswd = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pswdSec)
$pswd = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($bPswd)
$pswd

Note that you must create and use the password with the same account!

Tags: VMware

Similar Questions

  • I'm unable to access my computer (windows 8) with my microsoft account. The password works for the connection to outlook on the internet, but not the computer.

    Original title: connection problem

    I'm unable to access my computer (windows 8) with my microsoft account. The password works for the connection to outlook on the internet, but not the computer.

    The message I get when trying to connect is simply that I cannot connect you at this time and that I should follow a link to reset the password - what I've done without result. The computer is connected to the internet.

    Hello

    Thanks for posting your query on the Microsoft Community.

    With the publication of the description, I understand that you are unable to access your computer using Microsoft password account on the machine Windows 8. I will certainly help you get this problem.

    I would be grateful if you could help me with more information:

    1. Since when you are facing this problem?

    2. What is the exact error you receive by accessing the computer?

    I would say to you follow the suggestions provided by Cliff_N responded on 7 December 2012 in the below thread Microsoft:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_8-security/why-cant-i-sign-into-Windows-8-with-my-Microsoft/7662ea57-c321-4bfe-84e9-fc9ebb87a44b?TM=1355519512755#_self

    Important information: When you use system restore to restore the computer to a previous state, the programs and updates that you have installed are removed.

    Note: When updating, the applications you have installed Web sites and DVDS is deleted. The applications provided with your PC and applications that you have installed in the Windows store will be resettled. Windows puts a list of apps removed on your desktop after you refresh your PC.

    For more information, you can consult the Microsoft article.

    What to do if you forget your Windows password

    http://Windows.Microsoft.com/en-us/Windows/what-do-forget-Windows-password#1TC=Windows-8

    Hope this information is useful. Please come back to write to us if you need more help, we will be happy to help you.

  • hide the password recovery catalog in script

    Hi all

    I wanted to know what are all the options, the community uses when it comes to hide the recovery catalog owner password? of course, when you save another DB in our environment, we use a recovery catalog and connect using the user/password@recovery_catalog in our script. so if anyone has access to read our script can find the password of the recovery catalog owner. I wanted to see what is the dose of rest of the dose of community to hide the recovery catalog password?

    What is the version of db, which we are discussing here? If its 11g, you can create the virtual catalog owners on the top of the catalog and allows to manage your db. Other than that, you can store the password in the wallet on the client side and use it without Hardcoding it.
    http://www.Oracle-base.com/articles/10G/secure-external-password-store-10gR2.php

    Aman...

  • What is "you want to update the password saved for"

    Given that I deleted prefs.js and user.js when I connect to any account in the upper-left appears
    "you want to update the password saved for" this interferes with the connection and now it won't let me connect you to your e-mail account.
    I wonder where it appears? I don't want to use it and want better to delete, but don't know how?
    I wanted to add a page in this issue, but as usual Firefox won't like that I guess. So, after this announcement I'll add.

    Thank you.

    Hello

    Thanks for the very useful reply.
    I followed the direction and it seems to work.

  • I'm trying to access a wireless network with the password provided for me. I get the following error message

    I'm trying to access a wireless network with the password provided for me. I get the following error message: "the network password needs to be 40bits or 104bits depending on your network configuration. This can be entered as 5 or 13 characters ascii or hexadecimal 10 or 26. "what does this error message mean and how do I address so that I can access the wireless network?

    I use XP Professional with service pack 3. I get this error message every other time I try to log in to a protected wireless network security. I used to not get this message; but, now, it may be impossible, sometimes to call all wireless providers when I might only need for a short period or after hours service opening.

    In addition, it is my computer that requires the network password to be different, not the provider of wireless. A password is given to me who works for other users, but my computer won't let me use it.

    Hello

    I suggest you to visit these links and check if it helps:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-networking/the-network-password-needs-to-be-40-bits-or-104/f3fdc3ee-CB40-4107-A632-082093dcdcb8

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-networking/need-to-connect-to-home-wireless-network-Windows/5bf37a22-cc42-4a0f-9d15-83e780f00123

    It will be useful.

  • 3407: cannot allocate space to store the property information for global cache

    Salvation of the experts on the issue of a load in ttisql as follows, statement

    CACHE LOAD domain_group GROUP COMMIT ALL 256 LINES;

    This exception is thrown, and I can't find anything with google:

    3407: cannot allocate space to store the property information for the global cache groups because the space in the partition of the temporary data is less than the minimum threshold of 3000000 bytes--of the Member MG2_alone2_1 of the grid

    My my_ttdb DSN is configed as follows:
    [my_ttdb]
    Driver=/home/TimesTen/TimesTen/tt1122/lib/libtten.so
    Data store = / home/timesten/data/database / my_ttdb
    LogDir = / home/timesten/logs
    PermSize = 4000
    TempSize = 32
    DatabaseCharacterSet = AL32UTF8
    OracleNetServiceName = amq_915

    The result of cachegroups is:

    Group cache CACHEUSER. DOMAIN_GROUP:

    Group cache type: asynchronous, Writethrough global (dynamic)
    AutoRefresh: No.
    Breeding: LRU on

    Table roots: GTLD_WHOIS_TEST. GTLD_DOMAIN
    Type of table: spread


    Child table: GTLD_WHOIS_TEST. GTLD_DOMAIN_STATUS
    Type of table: spread

    The County of gtld_domain table is 3,005 million records in the gtld_domain_status table.

    Waiting for your help, thank you.

    According to the error message you need to increase the temporary data partition which is the TempSize setting in your DSN.

    As point of departure set to 1000 and then to monitor it in ttIsql with the dssize command to see if it needs to raise more or may be reduced after a workload has been run.

    Tim

  • How can I store the passwords that have been deleted

    I had the usernames and passwords stored for multiple accounts of e-mail on the same site. These have been accidentally deleted from the list of saved passwords, and now I can't get Firefox (23.0) to remember once again. I have no password check enabled (behind a master password), and this site does not appear on the list of "exceptions." In the password management utility, there is no facility to add new passwords, not to remove them. It seems, once removed, Firefox assumes one will never want to save this site again.

    I'm in and out of these accounts literally dozens of times a day and now connect in the manual every time. How can I get Firefox saves these combinations of name of user and password for me again?

    Yes. AutoComplete = off is a direction that web sites can give a browser to instruct them not to store the data that you enter in an input field. This can be search terms that you enter on a Web site like Google, but also the privacy and security of sensitive data such as a credit card number.

    If you use the bookmarklet so you know what you are doing and give it a second thought.

    If you use the extension that you don't notice that a Web site prefers that you do not to save this data.

    With recording a password, you will need to confirm a prompt, but the other form data can be recalled if imperceptible autocomplete = off is removed.

  • store the password

    I use Firefox v. 5. I am unable to store passwords to external Web sites because the Firefox status bar is different from this: http://support.mozilla.com/en-US/kb/make-firefox-remember-usernames-and-passwords. No "key" symbol or icon is indicated in the bar, no 'key' appears among the various points in the ' tools > customize section.

    You can attach a screenshot?

    Use a type of compressed as PNG or JPG image to save the screenshot and make sure that you do not exceed the maximum file size (1 MB).

    See also:

    Make sure that you are not Firefox running in permanent private browsing mode.

    • https://support.Mozilla.com/kb/private+browsing
    • You enter private browsing mode, if you select: Tools > Options > privacy > History: Firefox will be: "don't forget the story ever.
    • To view the history settings and cookies, choose: Tools > Options > privacy, choose the setting Firefox will: use the custom settings for the story of
    • Uncheck the box: [] "Permanent private browsing Mode.
  • How can I retrieve or reset my password encryption for backup of iTunes to a new phone?

    I just bought an iPhone 6 and that it replaces an iPhone 5.   I want to transfer my data in iTunes but don't remember my password for encryption.   Is there a way to recover the password or change it?

    It is not recoverable.

    On safeguards encrypted in iTunes - Apple Support

  • Where can I find the hexadecimal encryption for the router?

    original title: WIRELESS IS ASKING for HEX ENCRYPTION WHERE I would NORMALLY PUT the PASSWORD

    My toshiba satellite pro 4600 when I entered the password, he said I was connected but didn't have no internet.  the signal strength is good... and the rest of my computers work properly.  I wonder if the encryption for the new router I'm not in the HEX code like I did in 'time' once, I entered a real password.  is there a screen somewhere in the router configuration that shows the translation of the password for the real hex/bit encryption?

    Thank you

    It is useless to ask technical questions in the forum Feedback so I moved your message on the forum 'Making in network and get online' Windows.  However, you neglected to mention your version of Windows.  Please provide that.

    Your router provided with documentation that describes the values by factory default, including encryption.  Most routers have no active encryption when fresh from the factory.

  • Is the password required for the upgrade?

    When I bought my HP computer, I went to the premium version of what was their current line of portable computers for personal use. This computer is equipped with a fingerprint scanner that is managed by HP SimplePass. Let me clarify this now - I don't speak of the HP SimplePass created by Digital Persona, but one made by AuthenTec Incorporated.

    As a side note, the software HP SimplePass was first made by AuthenTec Incorporated, a company that went under in 2012, despite the rest of the software in circulation. HP SimplePass has a one-stop shop for all your needs safety. You can register several prints of multiple hands, create an identity by providing a profile photo and an email and opt-in to have all your passwords on websites you visit saved. Sounds nice, right? The problem is that it automatically collects your passwords (including bank accounts online, purchases, suppliers, etc.) and since the business ceases to exist (seriously, the program Web site is 'under construction' *) who knows who or what is in control of your account... and the connection related information. There are probably tons of people which has provided a real image of themselves, their email and allowed without knowing their password to remember.

    Now, even if I would prefer a lot do not have to use the HP SimplePass application, I. I have created an administrator password after the purchase of this laptop, but registered my footprint for ease of use. I forgot since the administrator password only by making my mark all these years. When I realized everything first how unworthy of trust HP SimplePass is, I looked in reset my password, but never took the time to create a password reset disk when I did the password. I tried several third-party applications, all claiming to allow me to change my password. None worked, most was advertising machines, and some have been marked by my antivirus software to be malicious. I didn't pay $30 to have HP send me a password recovery disk, so I stuck with my fingerprints while the other features of HP SimplePass disabling.

    Recently booked an upgrade of Windows 10 on this computer, I'm a little worried. This update will require the administrator password? The HP SimplePass application is compatible with the upgrade? Please comment if you know something or have had the same problems with HP SimplePass! I would like to also some suggestions on the third-party applications that actually reset passwords!

    Business Web page: www.authentec.com

    Is your current account, an administrator account? If Yes, you do not need any third-party tool. Here's what you need to do:

    1. Log in under this admin account, by using the fingerprint reader.
    2. Click the start planet.
    3. Type cmd.exe in the search box.
    4. Press Ctrl + Shift + Enter
    5. Click on "Run as Administrator".
    6. Type the following commands and press ENTER after each:
      NET user "user %%nom" 123456
      (to set your password to 123456)
      NET user administrator abcxyz
      (to set the password for abcxyz)
      NET accounts /maxpwage: unlimited
      (to prevent the passwords expire)
    7. Log in as administrator to test the password.
    8. Create a folder printed of these passwords and store it in a place that you can not possibly forget. It is clear that relying on your memory will not work. It wouldn't work with my memory no more...
  • Check if the password expires for an AD user

    I need help to verify if the password will expire for a user of AD via Orchestrator.

    Passwords expire every 90 days.

    I found the code to show me where the password was last set, but is not readable.

    pwdLastSet = user.getAttribute("pwdLastSet");
    System.log("Password last set: " + pwdLastSet);
    

    Output:

    [10:23:46.208 2015-01-15] [I] the last game of password: 130657846662968750

    I found this on the pwdLastSet value: the value is stored as a large integer that represents the number of 100 nanoseconds since January 1, 1601 (UTC) intervals

    @andrewsardinha

    No such thing as native .net or PowerShell integration in workflows, you will need to run it on a remote machine of the PS that is not elegant.

    But you're right about the time windows (I was not aware MS has also had a custom time period). Details can be found here where TI know pwdLastSet is also one of the fields used with windows time.

    @jonathanvh

    Looks like you need to do the conversion yourself then. No generation function in JS basis I would like to know for windows-era. Without looking in it, in detail, it seems to be pretty easy by looking at this example in C.

    Basically, all you need to do to convert time UNIX WINDOWS-time is as follows:

    unixtime = (wintime - 116444736000000000) / 100000

    Then just use something like this to get your object date in javascript:

    var pwdate = new Date (Math.round (unixtime))

  • Return code for Powershell script of vCO

    Hello

    I tried to get the code back to a Powershell script run of vCO using the plugin. I can capture the output, but I'd like to get the exit code of the script (as specified by an instruction on the PS script exit).

    Here is my code vCO:

    try {}
    session = psHost.openSession ();
    script var = "&" ' + externalScript + ' "' + arguments;"
    result = session.invokeScript (script);
    If (result.invocationState == "Failed") {}
    throw "PowerShellInvocationError: errors found during execution of script \n" + result.getErrors ();
    }
    Display result
    var psOutput = result.getHostOutput ();
    var psErrors = result.getErrors ();
    var psResults = result.getResults ();
    System.log("output:"+psOutput);
    System.log("errors:"+psErrors);
    System.log("Results:"+psResults);
    } {Finally
    If {(session)
    psHost.closeSession (session.getSessionId ());
    }
    }

    As I said psOutput works very well and contains the output of STD, but I get always an empty string for psErrors and a NULL value for psResults, even when I change my script to deliberately leave with a different error code of 0.

    Does anyone have the code to output work?

    Thank you

    Juan.

    Juan of morning,

    could you try to return your $val in the PS?

    I take a look at our PS script where we

         return $ret
    

    the returncode we want.

    Kind regards

    Chris

  • How to reset the password forgotten for the Airport express

    I hid says on my airport express and I don't remember the password for it. How to reset the password

    If you have the version 2 ports of the AirPort Express, connect your computer directly to the LAN <>- Express port to see if you can access this way AirPort Utility.

    AirPort utility is as follows on your Mac: Finder > Applications > utilities > AirPort Utility.

    If you can 'see' the AirPort Express in this way... click on the image of the AirPort Express

    Click Edit in the window that appears

    Click on the menu on the Basic Station ... to the top of the screen, where you see the icon Apple, file menu, edit the menu, Menu Help window menu, etc.

    Click Show passwords and you will see your forgotten password

    If you are unable to access the AirPort Express Terminal using wired Ethernet, you can reset the password using one of the methods described in this excellent forum Tesserax an expert user tip.

    Airport - access to forgotten passwords

  • You forgot the password entered for laptop Windows 8?

    Forgotten password entered for my new laptop, widows 8? keep things simple I'm 79!

    Hello

    If or connect you with a Microsoft account, you can reset the password on your laptop using another computer - start at the link below.

    https://account.live.com/password/reset

    Kind regards

    DP - K

Maybe you are looking for