Encrypt the info of "Read-Host".

Hello:

I wrote a script that will use entries of users for the VC connection (s) and create the xml file.

Its works fine, but the info-name of user and password is not encrypted.

Is it possible to encrypt the entry in the "Read-Host" command?

Thank you

qwert

The reason is that Connect-VIServer does not have a System.Security.SecureString object.

With the parameter - Credential you can pass an object System.Management.Automation.PSCredential.

And you can easily convert from one to the other

$userName = "username"
$passwd = Read-Host ("Password for " + $userName) -AsSecureString:$true
$cred = New-Object System.Management.Automation.PSCredential -ArgumentList $userName,$passwd
Connect-VIServer -Server mmmstv105 -Credential $cred

____________

Blog: LucD notes

Twitter: lucd22

Tags: VMware

Similar Questions

  • SoftMotion cRIO - how to read the position of a host from a sample of the expedition?

    When you open the examples provided with NI SoftMotion, generally there are two loops. The main loop and a loop that contains the following message:

    "The position of reading and tracing normally would be on the host by reading data from the target.  This is done in this example for simplicity. »

    Then, we advise on the Panel before you go to ni.com/info/f/ and enter the info code nismex for more information on the use of this example in a system of real movement.

    My question may seem obvious, but how "read the position on the host by reading data from the target?

    I tried to use the block function NOR SoftMotion read inside a VI on the host, of course, it does not, because the resource is on target.

    Should I leave the second loop inside the VI running system cRIO and just no conspiracy, but subscribe to a shared variable? I see that you can do a right click on the function block and select if you want output to be a shared variable. Or this second loop is supposed to be removed from the VI running on the target RT? How reads the position then?

    To see an example of what I mean, open this example: C:\Program NIUninstaller Instruments\LabVIEW 2009\examples\Motion\FunctionBlocks\Axis Straight Line Move\Axis right Line.lvproj

    Thank you

    Fabiola

    Concerning priority and when you call the motion function blocks:

    The NI SoftMotion engine for cRIO uses a background 'pilot' that runs in phase of analysis on the CompactRIO system engine.  This provides the required sync and sync for motion runs correctly.  This 'pilot' motion function blocks, simply send asynchronous commands.  You can consider them as an API to the engine of control of movement control.  You are not required to synchronize the function of movement of the scanning engine blocks or even to perform at a highest priority.  However, you will probably choose to run these a higher priority or in a loop timed for reasons of prioritization of execution.  For more details on the NI SoftMotion architecture and recommendations on how to build movement on CompactRIO systems discover the CompactRIO (http://www.ni.com/compactriodevguide/) Developer Guide.  It has been updated in December 2009 and Chapter 5 now has much on the order of movement on CompactRIO complete with examples of projects.

  • I read the info on TBird messages to open in tabs. I put on it to open it in the main window, but it has not changed. Is there another solution?

    I did not understand the info on the action of the tabs. I followed the instructions for "open in an existing window", but messages still appear in the tabs at the top. I struggle to find my Inbox. Thank you, Martha

    If you select open in an existing Message, the first message that you double-click to open a new window always opens. If you leave this window open and you double-click a second message, it will open the new message in the existing message window.

    If you select open in a new window, all messages that double you click opens a new window. If you do not close the window after reading the messages you will be right where you are when you neglect to close the tab after reading the messages. You will have all messages that you have read open in a tab and the tab of the Inbox is pushed off the screen.

    After reading the message, close the tab or window.

    If you have lots of tabs open, you can right-click one of them and choose Close other tabs and then use the x on the last tab to close it.
    This will close the tab with the calendar of lightning inside you will need to reopen that.

    Have you tried to use the message pane to read messages and open them at all? F8 will toggle the message on and outside pane.

  • In Itunes and adobe reader all the latest versions have problems with the Info button.

    in Itunes no show buttons or the info for them, everything els is here, so the info botton if you move the cursor, if you can't find where they might be. Drive has the same problem but only in printing windo. Using Vista sp2 on a toshiba.

    Hi J Jewell,

    1. are you able to use other applications correctly?

    2. were you able to use iTunes & Adobe Reader correctly previously?

    3. don't you make changes on your computer before this problem?

    If you face this question only in iTunes & Adobe Reader, I recommend you to uninstall the applications of the program & features. Subsequently, reinstall them & check if the problem persists.

    To download Adobe Reader, please refer to this link: http://get.adobe.com/reader/

    To download iTunes, refer to this link: http://www.apple.com/confirm/itunes/thankyou.html

    Hope the helps of information.
    Please post back and we do know.

  • Script to reconnect the hosts using "Read-Host - AsSecureString".

    I'm trying to get a script that will reconnect all ESX host, when you use a server different vCenter (same database well). I found the bases of what I need here:

    PowerCLI blog

    But the only problem with that one is that the script has the password in clear text. I prefer to ask the password, as with the Read-Host - AsSecureString option. My script below works fine without the option - AsSecureString... when the Read-Host is not hidden. Can someone tell me how to make it work with the AsSecureString?

    $password = Read-Host - assecurestring "Please enter the root password"

    Get-VMHost | % {$view = get-view $_.id}

    $arg = New-Object vmware.vim.hostconnectspec

    $arg.userName = 'root '.

    $arg.password = $password

    $arg.force = $true

    $view. ReconnectHost ($arg)

    Thank you!

    Kyle

    The property of password in HostConnectSpec object requires a plaintext password.

    This means that you must use the method Robert provided in this post.

    I've attached a file (since the SW forum do not like the brackets) with your script suitable for this method.

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • Login script to viserver with reading-host name, user name and password assecurestring

    Hello

    I'm connecting to a server vCenter or ESX host at the beginning of another script script, so that it is generic, I want to invite the user for the name of the server, the user name and the password and pass it to connect-viserver. I would really like to password entry to be looked at by and that you can see how to do it, but if it is stored as a secure string, it does not pass in the connect-viserver command correctly. If I remove the assecurestring - it connects very well.

    $vc = read-host "enter the name of vCenter or ESX host name."

    $us = read-host "enter user name".

    $pw = read-host "Enter password" - assecurestring

    to connect-viserver $vc - user $us - pass $pw

    ...

    I tried to add the line:

    $pw = $pw | out-string

    But it is not convert it.

    How to read a string safe in the command?

    Thank you

    Dan

    Or use the script that I entered info ' Read-Host ' Encrypt

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • Need help to understand the DOM objects on host VSAN MDs

    I read the info that I could find on the disk objects (including best practices guide & blog of Cormac), but fail to wrap my head around why I see what I see.

    I have a motorized on VM (cvf1-wshark), who lives on a VSAN 3 nodes cluster. Each node has 1 SSD and 4 MD I uses all of the default policies (FTT, bandwidth, etc.).

    That said, I wonder why it is clear from the exit of the vsan.disk_object_info of order RVC who live on 3 of my knots VSAN VM objects. vSphere client shows the correct RAID0 between 2 hosts (13.21 & 13.23) mirroring a witness (13.22), but the DOM objects on 13.22 aren't cookies (which I don't expect to see objects anyway). So, what do these objects on 13.22? I see the same distribution for each of my virtual machines on this cluster.

    Thank you

    Steve

    Screen Shot 2014-04-15 at 11.07.48 AM.png

    Screen Shot 2014-04-15 at 11.08.03 AM.png

    ################

    13.21

    ################

    / localhost/VSAN-DC/Computers/VSAN cluster > vsan.disk_object_info. NAA.600605b006f7fb701ab6548453137d63

    2014-04-15 14:44:07 + 0000: VSAN recovery disk info from 192.168.13.21 (may take a moment)...

    2014-04-15 14:44:07 + 0000: VSAN recovery disk info from 192.168.13.23 (may take a moment)...

    2014-04-15 14:44:07 + 0000: VSAN recovery disk info from 192.168.13.22 (may take a moment)...

    2014-04-15 14:44:08 + 0000: does get disc info VSAN

    NAA.600605b006f7fb701ab6548453137d63 (52098356-69da-4ab9-b03f-11eea6025370) physical disk:

    The DOM object: 26533353-5452-fa2f-b0f6-0025b5c2622c (owner: 192.168.13.23, policy: hostFailuresToTolerate = 1).

    Context: Part of VM cvf1-wshark: directory of Namespace

    Witness: 27533353-c48b-63b3-90bb-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.22, md: naa.600605b006f7dae01ab65f7317f942d1, ssd: naa.600605b006f7dae01abde7e20e633fb2)

    RAID_1

    Component: 27533353-ba62-62b3-d5c4-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.21, md: * naa.600605b006f7fb701ab6548453137d63* *, ssd: naa.600605b006f7fb701abde07e0de6c455)

    Component: 27533353-eeb5-60b3-7ddc-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.23, md: naa.600605b006f7f9701ab604452752b6b4, ssd: naa.600605b006f7f9701abe00d3102940d7)

    The DOM object: 29533353-76d4-69d0-5601-0025b5c2622c (owner: 192.168.13.23, policy: hostFailuresToTolerate = 1).

    Context: Part of VM cvf1-wshark: disc: [vsanDatastore] 26533353-5452-fa2f-b0f6-0025b5c2622c/cvf1-wshark.vmdk

    Witness: 29533353-0247-fce9-c547-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.22, md: naa.600605b006f7dae01ab65f7317f942d1, ssd: naa.600605b006f7dae01abde7e20e633fb2)

    RAID_1

    Component: 29533353-829d-fbe9-22fc-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.21, md: * naa.600605b006f7fb701ab6548453137d63* *, ssd: naa.600605b006f7fb701abde07e0de6c455)

    Component: 29533353-eebd-fae9-7ec5-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.23, md: naa.600605b006f7f9701ab604452752b6b4, ssd: naa.600605b006f7f9701abe00d3102940d7)

    ################

    13.22

    ################

    / localhost/VSAN-DC/Computers/VSAN cluster > vsan.disk_object_info. NAA.600605b006f7dae01ab65f7317f942d1

    NAA.600605b006f7dae01ab65f7317f942d1 (5226984a-510a-dab6-86c0-1950f37a4ee2) physical disk:

    The DOM object: 26533353-5452-fa2f-b0f6-0025b5c2622c (owner: 192.168.13.23, policy: hostFailuresToTolerate = 1).

    Context: Part of VM cvf1-wshark: directory of Namespace

    Witness: 27533353-c48b-63b3-90bb-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.22, md: * naa.600605b006f7dae01ab65f7317f942d1* *, ssd: naa.600605b006f7dae01abde7e20e633fb2)

    RAID_1

    Component: 27533353-ba62-62b3-d5c4-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.21, md: naa.600605b006f7fb701ab6548453137d63, ssd: naa.600605b006f7fb701abde07e0de6c455)

    Component: 27533353-eeb5-60b3-7ddc-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.23, md: naa.600605b006f7f9701ab604452752b6b4, ssd: naa.600605b006f7f9701abe00d3102940d7)

    The DOM object: 29533353-76d4-69d0-5601-0025b5c2622c (owner: 192.168.13.23, policy: hostFailuresToTolerate = 1).

    Context: Part of VM cvf1-wshark: disc: [vsanDatastore] 26533353-5452-fa2f-b0f6-0025b5c2622c/cvf1-wshark.vmdk

    Witness: 29533353-0247-fce9-c547-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.22, md: * naa.600605b006f7dae01ab65f7317f942d1* *, ssd: naa.600605b006f7dae01abde7e20e633fb2)

    RAID_1

    Component: 29533353-829d-fbe9-22fc-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.21, md: naa.600605b006f7fb701ab6548453137d63, ssd: naa.600605b006f7fb701abde07e0de6c455)

    Component: 29533353-eebd-fae9-7ec5-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.23, md: naa.600605b006f7f9701ab604452752b6b4, ssd: naa.600605b006f7f9701abe00d3102940d7)

    ################

    13.23

    ################

    / localhost/VSAN-DC/Computers/VSAN cluster > vsan.disk_object_info. NAA.600605b006f7f9701ab604452752b6b4

    NAA.600605b006f7f9701ab604452752b6b4 (52cd5b55-c160-3fd8-2285-cfadc7b5d11e) physical disk:

    The DOM object: 26533353-5452-fa2f-b0f6-0025b5c2622c (owner: 192.168.13.23, policy: hostFailuresToTolerate = 1).

    Context: Part of VM cvf1-wshark: directory of Namespace

    Witness: 27533353-c48b-63b3-90bb-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.22, md: naa.600605b006f7dae01ab65f7317f942d1, ssd: naa.600605b006f7dae01abde7e20e633fb2)

    RAID_1

    Component: 27533353-ba62-62b3-d5c4-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.21, md: naa.600605b006f7fb701ab6548453137d63, ssd: naa.600605b006f7fb701abde07e0de6c455)

    Component: 27533353-eeb5-60b3-7ddc-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.23, md: * naa.600605b006f7f9701ab604452752b6b4* *, ssd: naa.600605b006f7f9701abe00d3102940d7)

    The DOM object: 29533353-76d4-69d0-5601-0025b5c2622c (owner: 192.168.13.23, policy: hostFailuresToTolerate = 1).

    Context: Part of VM cvf1-wshark: disc: [vsanDatastore] 26533353-5452-fa2f-b0f6-0025b5c2622c/cvf1-wshark.vmdk

    Witness: 29533353-0247-fce9-c547-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.22, md: naa.600605b006f7dae01ab65f7317f942d1, ssd: naa.600605b006f7dae01abde7e20e633fb2)

    RAID_1

    Component: 29533353-829d-fbe9-22fc-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.21, md: naa.600605b006f7fb701ab6548453137d63, ssd: naa.600605b006f7fb701abde07e0de6c455)

    Component: 29533353-eebd-fae9-7ec5-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.23, md: * naa.600605b006f7f9701ab604452752b6b4* *, ssd: naa.600605b006f7f9701abe00d3102940d7)

    Yep - it is a quite normal output.

    As Duncan suggests above, your poster only the same information each time your run of the command.

    And each object is composed of 3 elements (2 x replicas of RAID-1 + the witness).

    The other thing to watch is that this command is more information that you have requested, i.e. all components. However, components that are active for the disc that you put as an argument to the command are going to be wrapped in * double Asterix *.

    For example:

    The DOM object: 26533353-5452-fa2f-b0f6-0025b5c2622c (owner: 192.168.13.23, policy: hostFailuresToTolerate = 1).

    Context: Part of VM cvf1-wshark: directory of Namespace

    Witness: 27533353-c48b-63b3-90bb-0025b5c2622c (State: ACTIVE (5), the host: 192.168.13.22, md: * naa.600605b006f7dae01ab65f7317f942d1* *, ssd: naa.600605b006f7dae01abde7e20e633fb2)

    HTH

    Cormac

  • I would like to know how to encrypt the phone to stop access to my data

    I'm fine back my iPhone 5 for a 6sPlus of the iPhone. Before doing so, I would like to know how to encrypt the phone to stop access to my data. I was told that everything simply erase the data without actually deleting...

    < re-titled by host >

    What to do before you sell or give away your iPhone, iPad or iPod...

  • Hi, I used Firefox sync as a backup, because I had to format my hard drive, now I want to return info and it seems that I can't. Is all the same to retrieve the Info

    I have my username and password but never kept the recovery key original.
    What I read, I tried to use her replace all data with the server, but without the original key is not let me, and if I request a new key, it says that it will erase the info on the server.
    Can anyone help?
    Thank you

    I'm sorry, but if you do not have a backup of the sync key then all data stored on the server is lost and cannot be recovered.

    It is always better to make a backup locally on a Flash DRIVE or CD/DVD-ROM because synchronization is not intended to be used in this way.

  • Pavilion P7 - 1287c: my computer turns off itself, having the info dump but don't know how to fix.

    My HP Pavilion keeps stopping itself when I pt standby. When I come back he said it was a blue error screen.

    Here's the info dump;

    Signature of the problem:

    Problem event name: BlueScreen

    OS version: 6.1.7601.2.1.0.768.3

    Locale ID: 1033

    More information about the problem:

    BCCode: 9f

    BCP1: 0000000000000003

    BCP2: FFFFFA800775E060

    BCP3: FFFFF80000B9A3D8

    BCP4: FFFFFA800DA90C60

    OS version: 6_1_7601

    Service Pack: 1_0

    Product: 768_1

    Files helping to describe the problem:

    C:\Windows\Minidump\101315-20779-01.dmp

    C:\Users\CHI\AppData\Local\Temp\WER-94131-0.SysData.XML

    Read our privacy statement online:

    http://go.Microsoft.com/fwlink/?LinkId=104288 & clcid = 0 x 0409

    If the online privacy statement is not available, please read our offline privacy statement:

    C:\Windows\system32\en-US\erofflps.txt

    Any help would be appreciated. Do I need a BIOS update? My motherboard is dying?

    Thank you.

    Hello

    Please start Windows.

    Make a right-click on the icon my computer.

    Go to the properties

    Click on Advanced system Settings

    Click - system and recovery - advanced settings - uncheck/disable auto restart option tab

    Apply the changes and exit

    Enter the exact stop for the blue screen error code.

    Also update the graphics and the BIOS of hp website drivers.

  • Rinse the target DMA to host FIFO FPGA

    I have a program that runs on FPGA waiting for a ppr pulse 1 a coder, then begins to acquire data based on 4096 pulses of ppr. After that it becomes 4096 pulses, it synchronizes the back upward with the pulse of 1 ppr and recidivism. If the encoder stops spinning in the middle of a revolution, I have a timeout will happen, shouldn't get a pulse of 4096 in some time. This way my code isn't stuck wait pulses if the encoder stops turning. Then, it warns the user and synchronizes backup with the pulse of 1 ppr when spinning resumes.

    Well, the encoder stops at Midway through a revolution of spinning, I get a timeout, but now there are 2048 (4096 ppr * 0.5 revolutions) stale data points in the FIFO. I want to get rid of these points so that once it syncs back upward with the pulse of 1 ppr, I have data in the FIFO, all of the current revolution. I guess I could take the timeout error and trigger a loop on the side of RT that removes the elements until the FIFO is empty, but if it is not in time, before the encoder starts to turn once again, I still stuck with stale data. Maybe I need some sort of handshake with controls? I could also put FIFO for target on the FPGA for storing data and not the tail it to go to the host until it is all there. If I get a timeout, I could please rinse on the FPGA FIFO, because there is a method for flushing to target FIFOs.

    No matter which deals with this problem before, and how to solve?

    Hello

    I think that your first method is the best option. When you save a timeout, have triggered a case on your side of RT first making a FIFO reading which returns the number of items in the FIFO (but reads the items suck) and then immediately do a read FIFO that reads the number of items remaining. This will clear your FIFO and it should run quickly.

  • How resolve the error that reads "wmvcore2.dll's not found" after the installation of Cool Edit Pro 2.0?

    Hello

    I recently tried to install Cool Edit Pro 2.0 on my Dell laptop. After that it's over, I went to open the application, but the error which read "wmvcore2.dll is not found" message popped up. He suggested I have reinstall the application, so I did, but nothing helped.

    I wonder what I can do to solve this problem and can you give me any help will be greatly appreciated.

    Thank you.

    http://www.Microsoft.com/Windows/compatibility/Windows-Vista/default.aspx

    Windows Vista Compatibility Center

    First thing to do is to check its Vista compatibility at the link above, and if not to see what patches/solutions are available from its manufacturer...

    http://www.howtogeek.com/HOWTO/Windows-Vista/using-Windows-Vista-compatibility-mode/

    If this is not Vista compatible, read the info on the link above.
    It works for some programs, but not all.

    This applies to software programs, NOT hardware drivers.

    If it's Vista compatible > uninstall it > Re-download/save to your desktop > right click on the setup.exe > run as admin.

    If the above does not help, try to repost in Forum Vista programs:

    http://social.answers.Microsoft.com/forums/en-us/vistaprograms/threads

    See you soon.

    Mick Murphy - Microsoft partner

  • How to recover the software adobe reader

    I seem to have lost my adobe reader how it back

    http://get.Adobe.com/reader/

    Read the info on the link above.

    See you soon.

    Mick Murphy - Microsoft partner

  • problems of resettlement of CD to transfer the info from the old treo 680 again one

    After I accidentally broke my old treo 680, I got a new treo 680. I want to synchronize the info on my computer since my last synchronization successful the old Treo on the new treo. I read the instructions for the synchronization of a former palm OS device to another, say to install the software from the CD of the camera again on the CD of the previous device software. I tried to do, but when I insert CD of the new device in the drive of the computer of my Win XP Pro, nothing runs automatically. If I navigate on the CD and double-click autorun.exe, get the Palm resources on the screen (as if I had just finished the standard installation), rather than the installation wizard.

    Does this mean that I can go ahead and sync the new device safely without having to reinstall the software?

    If this is not the case, how can I get the next software installation wizard?

    Not sure if this is relevant, but my old treo 680 has been obtained directly from Palm, unlocked. My other came from TigerDirect and is supposed to be unlocked, but there the AT & T logo and packaging. I put in the SIM and battery and managed to make a phone call to test with it.

    Thanks in advance for any help you can give!

    If you replace one Palm OS device with another of the same model, there is no need to re - install any desktop software.  If the new device was previously owned, you would be Hard Reset to make sure that you start with a blank slate.  If it's really new (i.e. no previous owner), just connect your Hotsync cable.  It will ask you if you want to synchronize with an existing username or create a new.  Just select your current name.  All your applications and data should move to the new.

  • tried to create a private folder for the work of the book as the in-laws use our computer but don't know where to start and it seems to have sent the info im trying to hide anywhere please help

    tried to create a private folder for the work of the book as the in-laws use our computer but don't know where to start and it seems to have sent the info im trying to hide in every sense, please help, its windows 7 we have, I will learn more about computer but now I have to stop my son-inlaw through my belongings on the computer

    Nancy

                                                   

    Hi Nancy,.

    Encryption of files and folders is a way to protect against unauthorized access. EFS (ENCRYPTING File System) is a Windows feature that you can use to store information on your hard disk in an encrypted format. Encryption is the best protection that Windows provides to help you keep your information secure.

    You can make a folder and then encrypt it.

    http://Windows.Microsoft.com/en-in/Windows7/encrypt-or-decrypt-a-folder-or-file

    Good day!

    Answer please if you face concerns.

Maybe you are looking for