[SOLVED] - How to Rename a Win 7 Computer Using Powershell (deployment)

For those who just want to know what I'm trying to do here's my question:
How I can programmatically rename machines during the auditSystem/auditUser portion of Sysprep using PowerShell?
What is the exact command and/or function should I be issuing?
History:
I've scoured the web for a while but unsuccessfully located what I was looking for.  I'm preparing a Windows 7 Enterprise x86 image for deployment, and I need to rename the machine to match our current PC name schema before it is joined to the domain. 
I've managed to pull the information I needed to build the corret computer name thanks to Win32_BIOS.SerialNumber, Win32_ComputerSystem.Model and some IP<->Hashtable Array matching.  The next step is to actually rename the machine; This is
where I'm having trouble.
I found this code online :
Function Rename-ComputerName ([string]$NewComputerName){
$ComputerInfo = Get-WmiObject -Class Win32_ComputerSystem
$ComputerInfo.rename($NewComputerName)}
I also found
this code online :
function renameAndReboot([string]$computer, [string]$newname){
$comp = gwmi win32_computersystem  -computer $computer
$os   = gwmi win32_operatingsystem -computer $computer
$comp.Rename($newname)
$os.Reboot()}
Unfortunately, neither work in PowerShell on my reference image PC running Windows 7.  (However the first one works in PowerShell on my XP Virtual PC.)
The ReturnValue is 1326 when run on the Win 7 machine as the Administrator.  I'm not quite certain I understand what & why that fails or what exactly that code means.
Moving on, I decided to go down the WMIC path instead:
 WMIC ComputerSystem where Name="%computername%" call Rename Name="$NewName"
This works in CMD.exe on Windows XP and to my surprise, in CMD.exe on Windows 7 as well!  But, when run from PowerShell I get "Error: Invalid query".
Thinking PowerShell might not like the CMD.exe %COMPUTERNAME% environment variable, I sprang for the PowerShell $env:computername environment variable instead:
 WMIC ComputerSystem where Name="$env:computername" call Rename Name="$NewName"
That unfortunately results in an 'Unexpected switch at this level' error.
Other suggestions I've seen online were to use netdom, but that's not part of the Win 7 install and since I've historically been able to do this through WMI calls, it should be possible to do this in Win 7, Vista, Server etc.
I'm completely open to the idea that perhaps I'm doing something wrong.  If you have a tested solution, please share.

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component name="Microsoft-Windows-Security-SPP" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipRearm>1</SkipRearm>
</component>
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-Deployment" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Path>net user administrator /active:yes</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
<component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipAutoActivation>true</SkipAutoActivation>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<OEMInformation>
<Manufacturer>Company Name</Manufacturer>
<Model>Company Owned Hardware</Model>
<SupportHours>Mon-Fri 8 AM - 8 PM Central Time; excluding Holidays</SupportHours>
<SupportPhone>1-888-xxx-xxxx</SupportPhone>
<SupportURL>http://our.support.url.information</SupportURL>
<Logo>%WINDIR%\WallPapr2.bmp</Logo>
</OEMInformation>
<OEMWelcomeCenter>
<link>http://our.helpdesk.information</link>
</OEMWelcomeCenter>
<ComputerName></ComputerName>
<CopyProfile>true</CopyProfile>
<ShowWindowsLive>false</ShowWindowsLive>
<TimeZone>Central Standard Time</TimeZone>
<ProductKey>FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4</ProductKey>
</component>
<component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Identification>
<Credentials>
<Domain>domainname</Domain>
<Password>password</Password>
<Username>domainadmin</Username>
</Credentials>
<JoinDomain>domainname</JoinDomain>
<MachineObjectOU>OU=OU Information,DC=com</MachineObjectOU>
</Identification>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>en-us</InputLocale>
<SystemLocale>en-us</SystemLocale>
<UILanguage>en-us</UILanguage>
<UserLocale>en-us</UserLocale>
<UILanguageFallback>en-us</UILanguageFallback>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<AutoLogon>
<Password>
<Value>encrypted info</Value>
<PlainText>false</PlainText>
</Password>
<Enabled>true</Enabled>
<LogonCount>3</LogonCount>
<Username>administrator</Username>
</AutoLogon>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<CommandLine>%WINDIR%\Setup\Scripts\NewPC1.cmd</CommandLine>
<Description>Change Machine Name and Reboot</Description>
<Order>1</Order>
<RequiresUserInput>false</RequiresUserInput>
</SynchronousCommand>
<SynchronousCommand wcm:action="add">
<CommandLine>%WINDIR%\Setup\Scripts\NewPC2.cmd</CommandLine>
<Order>2</Order>
<RequiresUserInput>false</RequiresUserInput>
<Description>More Cleanup Work</Description>
</SynchronousCommand>
</FirstLogonCommands>
<OEMInformation>
<Manufacturer>Company Name</Manufacturer>
<Model>Company Owned Hardware</Model>
<SupportHours>M-F, 8 am - 8 pm Central excluding Holidays</SupportHours>
<SupportPhone>1-888-xxx-xxxx</SupportPhone>
<SupportURL>http://our.support.url.information</SupportURL>
</OEMInformation>
<OEMWelcomeCenter>
<link>http://our.helpdesk.information</link>
</OEMWelcomeCenter>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<NetworkLocation>Work</NetworkLocation>
<ProtectYourPC>3</ProtectYourPC>
</OOBE>
<UserAccounts>
<AdministratorPassword>
<Value>encrypted info</Value>
<PlainText>false</PlainText>
</AdministratorPassword>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>encrypted info</Value>
<PlainText>false</PlainText>
</Password>
<Description>Local Administrator</Description>
<DisplayName>Administrator</DisplayName>
<Group>Administrators</Group>
<Name>Administrator</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<RegisteredOrganization>Company Name</RegisteredOrganization>
<RegisteredOwner>Licensed CompanyEmployee</RegisteredOwner>
<TimeZone>Central standard Time</TimeZone>
</component>
</settings>
<cpi:offlineImage cpi:source="wim:location/of/install.wim#Windows 7 PROFESSIONAL" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
Jnaas. My Answer file?
I hope I didnt leave anything incriminating in that file...
The product key is the generic one for Windows 7 to tell it to use the KMS server.

Similar Messages

  • How to get Systemstate Backup size using PowerShell command in Windows 2008 R2

    Hi,
    We using WBSummary command to get completed backup status.
    I need to find how much data is backed up  using powerShell command .
    Is there any way to get the details , i can see the GUI but no in command.
    Please advise
    Regards Gopi K

    Hi,
    You mentioned that you can see the system state backup size in the GUI. Does the backup size mean the amount of date transferred?
    It seems that there is no such a PowerShell to get Systemstate Backup size. You may need to you need a PowerShell scripts to do this work.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=ITCG
    Regards,
    Mandy
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How to rename converted AAC filename using Nokia M...

    I'm using Nokia 3110. I encounterd some issue about the mp3 music fail to playback due to require activation code on my Nokia 3110 phone. I managed to overcome the activation code problem by using Nokia Music Manager. I just do not understand why this issue happen??? Because some of the songs from the same CD album do not have this activation code issue. FYI. I purhcase original CD.
    Second issue i'm still figuring is about how to rename AAC song as per my desire. The default file name after converted to ACC using Nokia Music Manager is 01-.AAC. I did try to rename it using Nokia Music Manager. But, once it downloaded to the phone. It still display the "original" file name, which is 01-.AAC. Please assist.
    Third issue is about the album information. How does Nokia Music Manager categories or get the "correct" album information? Some of the song name is incorrect after downloaded to the phone.
    from Music Lover

    Not come across the activation code issue at all.
    To stop the track number appearing in the file name:
    - open Music Manager (Transfer music option in PC Suite)
    - click Options .. Settings
    - unset the "Add track number to the file name when ripping content from CD" option
    You'll have to re-rip all your music again, though.
    If you don't want to do this, I'm sure there are tools around that will let you edit the track information in the file - try a search on this board or google.

  • How to create a context menu using powershell

    Hi 
    i would like to create a context menu for powershell but i am getting an error after powershell menu is created
    "This file does not have a program associated to it. i am using this script . I am trying to create a powershell shortcut on folders."
    also once it gets created i would like to open powershell as admin always
    New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
    Test-Path HKCR:\Directory\shell\Powershell
    New-Item -Path HKCR:\Directory\shell -Name Powershell
    Set-Item -Path HKCR:\Directory\shell\Powershell -Value "Open Powershell Here" 
    New-Item -Path HKCR:\Directory\shell\Powershell\key -Value "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command ""Set-Location -LiteralPath '%L'"""

    You need to put forth the effort to ask a good, clear, and meaningful question.
    As it stands, you seem to have a record of asking nearly unintelligible questions that take a great amount of effort for others to guess what you are asking. This is bad because it wastes everyone's time.
    Read these for some good information on how to ask good questions:
    Posting guidelines
    Handy tips for posting to this forum
    How to ask questions in a technical forum
    Rubber duck problem solving
    How to write a bad forum post
    -- Bill Stewart [Bill_Stewart]

  • How do I bulk upload documents using PowerShell and extract metadata from file name?

    I have a requirement to upload a bunch of documents into a document library. Based on the content type, the rules of updating the metadata is different...the one giving me trouble is to extract the metadata from the file name. If I have a file name like
    "part1_part2_part3.pdf" how do I extract part1, part2, part3 and tag each document being uploaded into SharePoint, using PowerShell? I have searched and have not been able to find anything to get me started.
    Has anyone done this before? Or is there a blog I can take a look at? Thanks
     

    You will have to write a PS script encompassing this logic.
    Read files from the folder using
    Get-Item cmdlet
    Determine the content type based on the path or filename.
    Split the file name to extract the tag names.
    If the metadata fields in the content type is a managed metadata field, check whether the term exists and set it.
    Updating SharePoint Managed Metadata Columns
    with PowerShell
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • How to get Metadata column values using powershell(CSOM)

    Hi,
    I am trying to get list column values using Powershell (CSOM), but I am getting for Metata data columns.
    I am getting internal value as System.Collections.Generic.Dictionary`2[System.String,System.Object] 
    Can anybody let me know how to get the values for metadata columns?
    Any help would be greatly appreciate.
    Thank you.
    AA.

    Hi
    Go through the links. It'll help.
    SharePoint 2013 Code Tips – Setting a Managed Metadata Field with the Client Object Model(CSOM and JSOM)
    Indul Hassan
    Microsoft Community Contributor
    http://www.indulhassan.com
    You Snooze.. You Lose !!

  • How to switch off the computer using the key on the keyboard?

    Hi,
    i've been using Mountain Lion for a while on my MBPr and when I wanted to switch off my mac, I used the key on the dashboard, then it asked me whether I wanted to switch off, restart or go on sleep mode... Now though with Mavericks, this button only makes it go on sleep mode...how to change the function of this key, in order to switch the computer off instead of sleep mode or how to get the window asking me what to do back?
    Thanks,
    BadGoldEagle

    It's a laptop, and when I don't use it i put it in a case and hide it (I've been burgled several times and I don't want to lose my Mac...
    About my friend: He was using his laptop when he had to go out (groceries....) and because he was in bed, he left it under his blanket to hide it form view... he put his computer to sleep. Unfortunately, windows update noticed something needed to be updated and switched back on the computer and during the update, it became kinda hot and it burned the CPU... bad...
    You'll understand I don't want to do that to my mac...
    And now all i have to do is wait 'till Apple brings an update to fix that...

  • How do you Install Win XP using Boot Camp without use of an optical drive?

    So I'm about at my wits end. I'm try to get Windows XP on my OS 10.5.5 MacBook Pro. I've run into what seems to be a bit of a dead in. Unfortunately my optical drive has gone stupid on me and won't allow me to get through the entire set-up. The Mac has know trouble seeing the Installation Disc. After my partition has been created and I click start Windows Installer, the computer reboots in a normal fashion up to when you get the apple with spinning progress wheel. At this point the screen goes black and I get a "-" blinking in the top right corner of the screen. I figure it's just trying to boot from Win Install disk but it just kinda sits there. So here's my question. Is there some way to boot this Windows Installation from anything else but the CD? I luckily have an image of the WinXP CD in about 5 formats. I'm going absolutely crazy because I had just Installed WinXP not more than an hour before I ran into this initial problem but wanted to change the WinXP partition to FAT 32 as opposed to the NTSC format I accidently used. I would really appriciate any help in my dark hour.
    System Info
    MacBook Pro 4.1
    Mac OS 10.5.5
    Bootcamp 2.1
    Windows XP with Service Pack 2
    HL-DT-ST DVDRW GSA-S10N
    System was just recently re-installed with fresh copy of a software and updates.

    Kirkdan:
    I really would like to help you and get your issue resolved in your dark hour as you said. I am afraid that I do not have good news for you. This is because the limitation put on by this entire process of installing Windows via boot camp.
    The answer to you question to install windows from any other medium other than your built-in optical drive is a NO. This won't work since once Windows begins to install then it will not have all the drivers installed to recognize the external CD drive (USB/Firewire) and installation will halt.
    Axel F.

  • How to rename a XML file using the file/FTP adapter

    Dear All,
    I am trying to rename a file using VARIABLE NAME SUBSTITUTION.
    My structure:
    <ns1:MSg xmlns:ns1="http://www.mycomp.inf.br/msr">
      <ns1:MSgVal type="A" Id="188549">
        <ns1:cab>
          <ns1:PO>4500000000</ns1:cPO>
          <ns1:BI>90000000011</ns1:cBI>
        </ns1:cab>
      </ns1:MSgVal>
    </ns1:MSg>
    How do I do to get the value 188549 from the field Id that is into the tag MSgVal?
    I created a variable var1 and my reference is:
    var1 --> payload:ns1:MSg,1,ns1:MSgVal,1,Id@,1
    I am getting the error:
    Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var1
    Regards,
    Fernando

    Hi,
    Like pinted by Michal, use Adapter Specific Identifers.
    In your mapping set the file name using the code in this link and then in your Receivr File Adapter select the Adapter Specific Identifiers --> FileName .
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
    Regards
    Bhavesh

  • How to connect to work computer using my iPad?

    How can I connect my iPad to my work computer?

    Dock cable. http://store.apple.com/us/product/MA591G/B?fnode=MTY1NDAzOQ&mco=MTA4NDc4NTY

  • How to connect to remote computer using ARD and AE

    Does anyone have detailed instructions on how I can us my AirPort Extreme and setup all the ports to allow the use of ARD remotely?

    You can configure your AirPort Extreme for ARD using the AirPort Utility. ARD is one of the choices under Port Mapping.
    You get to the port mapping option, as follows:
    Run the AirPort Utility.
    Select the AirPort Extreme, and then, select Edit.
    Select the Network tab to enable it.
    Click on the "+" button under the Port Settings field.
    Click on the drop-down arrow to the right of the Description field. (see image below)
    Select Apple Remote Desktop. This will automatically populate the other fields on the page.
    Select Save, and then, select Update.
    Allow the base station to reset.

  • [SOLVED]How exactly do you install Arch using UEFI?

    I want to switch my laptop to UEFI. I have a few questions I'd like to ask.
    * Does UEFI require a bios boot partition?
    * If not but I add a bios boot partition and efi partition is it true I can boot into my system both with UEFI enabled and not enabled?
    Will the following set my laptop to use UEFI?
    Create a partition scheme as follows;
    1. bios boot -- about 2mb -- ef02
    2. efi boot partition -- about 200mb (is this size about right?) -- fat32
    3. root -- 8300
    4. swap
    5. home -- 8300
    Then when I mount everything I make sure to mount the efi partition like
        mount /dev/sda2 /mnt/boot/efi
    It goes to /boot/efi right?
    Then when installing GRUB, I install it like;
        grub-install --efi-directory=/boot/efi --bootloader-id=grub_uefi --recheck
    And finally I'd run the
        grub-mkconfig -o /boot/grub/grub.cfg
    Is that the gist for the most part?
    Last edited by stevenmw (2014-12-18 17:51:37)

    Here is what I did,
    I booted Arch install media (not from UEFI).
    I made my partition scheme is gdisk:
      1. 2M -- ef02 -- BIOS boot
      2. 500M -- ef00  -- efi
      3. 30G -- 8300 -- root
      4. 12G -- 8200 -- swap
      5. 195G -- 8300 -- home
    I then did my mkfs:
      mkfs.ext2 /dev/sda2
      mkfs.fat -s2 -F32 /dev/sda2
      mkfs.ext4 /dev/sda3
      mkswap /dev/sda4
      mkfs.ext4 /dev/sda5
    When I first made my file extensions I made the mistake of not making the efi partition fat32. I knew it had to be fat32 and I wasn't sure if just making it ef00 was enough. So I searched Google. I didn't find much so I pushed forward.
    I eventually got an error when trying to do grub-install, it said /dev/sda2 does not look like and efi partition.
    So I thought about it, was it the size I chose, was it that I was just putting it in /boot, was it not fat32? I immediately decided it must not be fat32. And I was right. After a search I discovered I needed to do mkfs.fat. So I did this and success! Grub installed everything where it needed to be. (So it is true when they say Arch doesn't care if you have /boot/efi or /boot/EFI. Just using /boot is enough. That is fact.)
    But now I had another error. I forgot to install efibootmgr package... By this time I thought I had it so I started all over. This was actually my laptop so I wasn't going to give it more than two tries. So I started from scratch. A second and final try...
    I set up my partition scheme, did my mk stuff, and mounted all of my filesystems. Then Installed the base and base-devel packages. I went into arch-chroot on /mnt and then into a bash..
    I went through a couple of basic setup things and then I installed grub and efibootmgr. I then ran
        grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub_uefi --recheck
    Hooray! No errors reported! I checked /boot and everything was there and laid out perfectly!
    So I did the grub-mkconfig..... And rebooted.
    But it wouldn't boot!
    I started to dig around the Arch wiki and read it is a good idea to start out in UEFI mode and go into the  install media and proceed. So I tried this in a VM. The Arch install media would not start in UEFI mode. So I just came to the conclusion that there is something I am missing. Either in GRUB or something I don't understand about my laptop.
    I installed Fedora 21 in a VM out of UEFI mode and then again where I started out in UEFI mode. Starting out in UEFI mode did seem to make a difference. I just gave up on my laptop and installed it back with bios and no UEFI. I'm going to dig around and see if I can find what I'm doing wrong.
    Could it boil down to not being able to start out in UEFI mode and then switch back into UEFI mode after install? I highly doubt it. There is just something I'm missing..
    Marking this as solved. Thanks everyone.
    Edit:
    Starting out in UEFI mode made the difference! I just wasn't being patient with my VM. Starting out in UEFI mode and then performing the install makes the difference! After following that process I can boot into Arch using UEFI!
    Also, I mentioned I couldn't get Arch install media to start in UEFI. That was my fault. When i created my usb i didn't make it a UEFI bootable device! So I would go into my boot options and I would see UEFI but my usb only showed in the legacy list.
    Last edited by stevenmw (2014-12-18 20:47:57)

  • How do i restore my computer using time machine to how it was a few days ago?

    I installed Maverick.  It was not a horrid idea but I cannot sync my iphone and ipad mail/contacts etc except through icloud.  And that just doesn't work for me.  The solution seems to be to restore my HD to its state prior to when i installed Maverick.  But that was a few days ago.  Luckily, I do have Time Machine.  Things are backed up, but I am a little unclear how I go about restoring to a previous incarnation of the harddrive, rather than the current one.  When I got a new HD it was easy, just plugged it in and TM transferred everything.  But I don't want to transfer the current version, I want the version from a few days ago.  How do I do this?

    Welcome to Apple Support Communities
    To restore a Time Machine backup, hold Command and R keys while your MacBook Pro is starting up to start up in OS X Recovery. Then, plug the external drive with the Time Machine backups, and choose the option to restore a Time Machine backup.
    It will let you choose which backup you want to restore, so select it and follow its steps. The hard drive will be erased

  • [Solved] How to set Code::Blocks to use Terminator!

    Hello All,
    I've recently just gotten into using an IDE to develop teh 1337 codez.
    Ignoring my silliness, I noticed that I can customize C::B to use whichever terminal emulator I like but I'm having trouble with using terminator.
    I've tried the following in the Settings :
    /usr/bin/terminator -t $TITLE -e
    terminator -t $TITLE -e
    terminator $TITLE
    And none of these have worked. Anyone have any suggestions? And yes, terminator is in my /usr/bin directory as evidenced by the output of "which terminator", which is /usr/bin/terminator
    Edit: Nevermind, I did it! Yay! Wanna know what worked? It was this (for once a man page was useful to me) : terminator -T $TITLE -x
    Last edited by MutantJohn (2013-08-23 23:30:39)

    There isn't a "code base" for java stored procedures ... that's an applet's issue.
    for more details about java stored procedures
    review teh java dev. guide and java stored proc guide located at :
    OTN FORUM ENTRY --> Oracle 8.1.7 Java Online Documentation
    http://technet.oracle.com:89/ubb/Forum18/HTML/001567.html
    null

  • How do I set Force Encryption using PowerShell

    I have to automate the task of setting Force Encryption (within Properties under SQL Server Configuration Manager, Network Configuration, Protocols for MSSQLSERVER). Do you know the PowerShell command to set Force Encryption to Yes? Any help would be appreciated.
    I can see some TCP configurations with this command, but I cannot see the Properties:
    $MachineObject = new-object ('Microsoft.SqlServer.Management.Smo.WMI.ManagedComputer');
    $ProtocolUri = "ManagedComputer[@Name='" + (get-item env:\computername).Value + "']/ServerInstance[@Name='MSSQLSERVER']/ServerProtocol";
    $tcp = $MachineObject.getsmoobject($ProtocolUri + "[@Name='Tcp']");$tcp;

    I had to use a registry hack to change this value. Unfortunately, it is not the best way to make changes to an SQL server:
    $RegKey = "HKLM:\Software\Microsoft\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQLServer\SuperSocketNetLib";
    Set-ItemProperty -path $RegKey -name ForceEncryption -value "1";

Maybe you are looking for

  • Upgrade to ECC 6.04 PHASE: MAIN_SHDIMP/SHADOW_IMPORT_INC were negative

    Hello! We are busy upgrading from ERP 2004 to ECC 604 SR1. Error: Checks after phase MAIN_SHDIMP/SHADOW_IMPORT_INC were negative! Last error code set: Unresolved requests in buffer TST Check logfiles 'SHDALLIMP.ELG' and '/binaries/sap/TST/upg/abap/lo

  • Rollover help in site design

    Newbie to fireworks here. I m more used to PS and exporting to image ready for rollover effects. I generally design my entire site page and export to IR, than add the frames to show the rollover effects and export. Seems simple enough. However, I can

  • Toolbar Bookmarks = Broken in FF 4.0

    In FF4.0, my Toolbar bookmarks do not do anything when I click on them. And I can not open a new tab by clicking on the "+" for new tabs.

  • Creating Clouds Shadows

    I am looking for some advice/help in creating cloud shadows in landscape shots.  I currently just use the burn tool to randomly put in darker areas to simulate cloud shadows on the ground.  I've become pretty good at it. BUT ... I am wondering if the

  • How to pull up my libray one another computer

    my husband and I both have ipods and laptops.  How do I upload his own account with all his songs on my computer with out him loseing any of his songs or mixing them with mine.  He uses both computers.  He have 3 out of 5 computer on his account. Tha