Changing Computer Descriptions Remotely using Powershell

Hello,
I am the Network Admin for a small college that has a little over 300 computers. I want to be able to use PowerShell to change the computer descriptions on those machines from my desk. I have PowerShell 3.0 installed on my system. I am new to PowerShell
so I could use some step by step instructions on what to do.
For instance:
I have a computer in my network that has a Computer Name of "19XP9175" and a description of "Optiplex 320 - Doreen Lane".
I would like to change the description to read "O320-Doreen lane"  from my system using PowerShell 3.0.
Can you give me some pointers on how to do this?
Thanks
Daryl

This may not help with Powershell side of things, but we had a similar issue where we needed to change 100's of remote computer descriptions, so we created this tool:
<snip>
It allows you to local or remote connect to a computer on a network (run it with admin rights!) and gather and change the description immediately without requirement for reboot etc. 
Hope it helps.
<snip>
So why are you bumping an old, answered thread in a PowerShell forum then? I get that you want to advertise your product, but at least keep on topic.
Don't retire TechNet! -
(Don't give up yet - 12,700+ strong and growing)

Similar Messages

  • Running a non mandatory program from remote using powershell without a logged in user

    Hi all,
    is there a way to execute a non mandatory program (a task sequence in my case) from remote using powershell
    without a logged in user on the target system?
    I have the following code: 
    $ProgramObject = Get-WmiObject -Class CCM_Program -Namespace "root\ccm\clientsdk" -ComputerName $ComputerItem | Where-Object { $_.Name -match "$ProgramName" }
    Invoke-WmiMethod -class CCM_ProgramsManager -Namespace "root\ccm\clientsdk" -Name ExecutePrograms -argumentlist $ProgramObject -ComputerName $ComputerItem | Out-Null
    Works like charm, but only with a user logged in on the target system what is not a good solution for me. 
    I saw some other ways on the internet but these only work when the program is mandatory.
    Is there a way to archive what I need ? 
    thanks 

    Hi,
    If you deploy the program as a available deployment, there need a user to run the program. Otherwise, the program will never run. This is contradicted with your requirement(run the program at log off).
    So I concur with Peter.
    Best Regards,
    Joyce
    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.

  • Script for change IP static address using Powershell

    Hi...
    I have a question: I regularly connect me to two different network segments, I want to know how to create a script to map to the network adapter an IP static, in this way could run the corresponding script when I find in each segment of the network using
    powershell... the DHCP  not permitt in company, is for that reason that I need a way to automate the allocation of IP address static in my network adapter, in this way could change the IP address depending on the network segment that I find.
    I hope your comments..
    Thanks

    Start by looking here:
    http://gallery.technet.microsoft.com/site/search?f%5B0%5D.Type=RootCategory&f%5B0%5D.Value=networking&f%5B0%5D.Text=Networking&f%5B1%5D.Type=SubCategory&f%5B1%5D.Value=clientside&f%5B1%5D.Text=Client-Side%20Management
    ¯\_(ツ)_/¯

  • Publish App-V applications to XenApp servers remotely using PowerShell

    Hi
    We have a XenApp/App-V 5 environment in which our applications are published globally from a content share by way of a startup PowerShell script. The XenApp servers are scheduled to reboot every other night to keep the PVS image clean and all is working
    well.
    Apart from when we have a scenario where we need to rush out an application update etc at short notice. Because half the servers reboot one night then the other half the next, ordinarily we have to wait two days after placing an updated app in the content
    share to ensure it's published on all the production servers.
    To try and avoid forcibly restarting servers out of sequence, or manually publishing apps on lots of servers, I was hoping to create a PowerShell script to allow us to publish an application remotely when needed and came up with this:
    $s = New-PSSession -ComputerName (Get-Content "Servers.txt")
    Invoke-Command -Session $s -ScriptBlock {
        Add-AppvClientPackage "\\appvcontent\Apps\Application.appv" | Publish-AppvClientPackage -global
    $s | Remove-PSSession
    I've enabled Windows Remote Management on the servers and while I can run other PowerShell commands in the scriptblock fine, when I enter the App-V publishing command I get:
    Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
        + CategoryInfo          : NotSpecified: (:) [Add-AppvClientPackage], UnauthorizedAccessException
        + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.AppV.AppvClientPowerShell.AddAppvPackage
        + PSComputerName        : <computername>
    Has anyone come across a similar scenario or can anybody suggest why I'm getting the access denied error? I'm running the script with an account that has admin permissions on the target server. I've tried moving the appv package locally
    on the target server but still get the same error.
    Thanks

    Add-AppvClientPackage requires admin privileges on the machine, so you should verify that the remote command is really executed with the right permissions. Does the remote call work in general (like try to create a file in the (remote) user profile)
    Falko
    Twitter
    @kirk_tn   |   Blog
    kirxblog   |   Web
    kirx.org   |   Fireside
    appvbook.com
    Hi Falko
    The remote call definitely works correctly with full admin privileges. I've just removed the AppV publish command and replaced it with a command to create a txt file in the local administrator profile on the target server and it works perfectly. It's just
    the AppV publish command that doesn't work.
    I'm looking in Event Viewer to see if I can find any further detail but can't spot anything.
    Thanks

  • How to add "Computer Description" locally to 300 Servers in our domain via PowerShell.

    I'd like to use Powershell to add "Computer Description" locally to 300 Servers in domain.
    I found a solution here which works but it adds "Computer Description" only to a single computer.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/a777f07c-f9be-4eb5-8788-de7e5c068411/changing-computer-descriptions-remotely-using-powershell?forum=winserverpowershell
    I do have a CSV file with two column headers "Server" and "Description" containing Computer Description for all 300 Servers. 
    I'm new to Powershell and would appreciate a step by step method.
    Thanks.
    st

    Hi Mike Laughlin,
    Your Script worked beautifully on most Servers.
    There were some Servers on which it did not work. It showed this error in red color:
    Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT:
    0x800706BA)
    At line:2 char:17
    +     $OSValues = Get-WmiObject -Class Win32_OperatingSystem -ComputerName
    $_.Serv ...
    +
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [Get-WmiObject], COMExcept
       ion
        + FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands
       .GetWmiObjectCommand
    Property 'Description' cannot be found on this object; make sure it exists and
    is settable.
    At line:3 char:5
    +     $OSValues.Description = $_.Description
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : PropertyNotFound
    You cannot call a method on a null-valued expression.
    At line:4 char:5
    +     $OSValues.Put()
    +     ~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    Hi tommymaynard,
    Should I now try your Script ?

  • How to set IPaddress to a VM which has Linux OS using powershell remoting.

    I have downloaded the SetLinuxVM scripts for setting the ipaddress of virtual machine which has Linux as OS. I have 2 different Hyperv host machines for Eg: HostServer1 and HostServer2  and I have installed SetLinuxVM scripts on server HostServer1 but
    my LinuxVM is created in HostServer2 and is highly available.
    Now I have development server from where I connect to any of these HyperV servers remotely .
    I have created powershell remote session from my development server to HostServer1 where SetLinuxVM scripts are installed and excuting the script as given below.
    Set-LinuxVM -VMName "TestLinuxVM" -Manager "Hyper-V" -VMHost "HostServer2"
    -Username "root" -Password "Gen#123" -Hostname "TestLinuxSrv " -IPAddress "192.168.2.2" -SubnetMask "255.255.0.0" -GatewayAddress "192.168.2.1" -PrimaryDNSAddress "8.8.8.8" 
    Even though I am providing the -VMHost and even if the VM is in cluster its not executing the scripts and I am getting the error  WMI not available.
    Its working fine if the scripts are installed on HostServer2 where the LinuxVM is created but my question is that do we need to install the scripts on all HyperV hosts then whats the use of the above parameter -VMHost "HostServer2"  because if
    the hyperv host is remotely connected using powershell we need to provide the VMHost name in the above scripts.
    From the examples provided in the SetLinuxVM module my understanding is that if the SetLinuxVM module is installed in any of the Hyperv servers which  are in a cluster and even though the VM is created in any of the servers and is highly available by just
    providing the VMHost for that particular VM we can set the IPadress ,hostname etc by connecting remotely using powershell to the HostServer which has SetLinuxVM module by providing the VMHost name in the above script .
     Hoping that my problem will be resolved at your earliest convenience.
    Thanks in advance,
    Fayaz Syed.
    FayazSyed

    I am not familiar with these scripts, but in general any modules must exist on the target Hyper-V server.
    The commands do not appear to be suing SCVMM, in which case you would execute the PowerShell script at the VMM console machine.
    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.

  • Value change using DataSocket can't create value change event on remote computer?

    I am trying to create an event on the remote computer:
    Local computer:
    Change a value in remote computer by DataSocket.
    Remote Computer:
    create a event: when the value changes.
    I can see the value change on the remote computer; however, the value change doesn't cause the "value change event".
    Anyone tried this before?  Thanks.
    ------- LabVIEW 2009, So Easy, Even a Therapist Can Do It -------

    Hi,
    Event Structure monitors a specified event based on user interaction on the front-panel objects. However, it does not monitor event generated programmatically like a change in the DataSocket data value. In order to generate a value change event with the DataSocket, you will need to use the "value (signaling)" property node for the DataSocket data or control. This property node sets the value of the control and also generates a Value Change event.
    To create the property node, simply right click the control and select "Create>>Property Node>> Value (Signaling)". You can then wire the output from the DataSocket read to this property.
    You can also checkout this knowledgebase entry for additional information.
    Tunde

  • [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.

  • Change content of default.aspx for subsites using Powershell

    Hi.
    I need to update the content of the default.aspx of 60+ subsites in a site Collection. I am able to loop all subsites and get the corresponding default.aspx files using a PowerShell snippet like:
    $site = Get-SPSite -WebApplication https://mysite.domain.no/ -Limit All
    $wc = $site.allwebs | where {$_.url.StartsWith(https://mysite.domain.no/sites/blahblah/blahblahblah) }
    foreach ($web in $wc){
    $file = $web.GetFile("default.aspx")
    The problem is I don't know whether to use the Set-Content command-let or an XMLDocument approach.
    I have the file With the correct content on the local machine. I tried With $file.Parentfolder in order to use
    $f = $web.GetFolder($file.ParentFolder)
    $fc = $f.files
    Get-ChildItem "C:\temp\default.aspx" | foreach {
    $spFileCollection.add($($_.Name),$_.OpenRead(), $true)
    to replace the file but this gives an error on empty folder. Can I use this approach or is there a way to change the actual content of the file?

    Hi Jorgen,
    According to your description, my understanding is that you want to update the page content using PowerShell.
    I suggest you read the content data like below:
    $data = $file.OpenBinary()
    $encode = New-Object System.Text.ASCIIEncoding
    $test = $encode.GetString($data)
    Then you can change the string you want, and then you can save it using SaveBinary() method.
    Here are some detailed articles for your reference:
    Reading the contents of a SharePoint library file using PowerShell
    Using powershell to read/modify/rewrite sharepoint xml document
    Best Regards
    Zhengyu Guo
    TechNet Community Support

  • Installing SQL Server 2012 remotely via Powershell using Invoke-Command

    I am trying to perform a SQL Server 2012 command line installation using Powershell Invoke-Command on Windows 2012 Datacenter.
    The code I am using is as follows:
     $ret = Invoke-Command -ComputerName $COMPUTER -ArgumentList $MEDIA,$ACTION,$FEATURES,$INSTALLDIR,$INSTANCEID,$INSTANCENAME,$SQLDATADRIVE,$SQLLOGDRIVE,$DOMAIN,$SQLSERVERSERVICEUSER,$SQLSERVICEPASSWORD,$PRODUCTKEY,$SQLSERVERSA,$username,$ADMINPASSWD
    -Credential $cred -ScriptBlock {
      param($MEDIA,
         $ACTION,
         $FEATURES,
         $INSTALLDIR,
         $INSTANCEID,
         $INSTANCENAME,
         $SQLDATADRIVE,
         $SQLLOGDRIVE,
         $DOMAIN,
         $SQLSERVERSERVICEUSER,
         $SQLSERVICEPASSWORD,
         $PRODUCTKEY,
         $SQLSERVERSA,
         $USERNAME,
         $PASSWD)
      Set-Location $MEDIA
      Import-Module ServerManager
      if (-not [IO.Directory]::Exists($MEDIA)){
       $hn = hostname
       return 0,"Failed to find SQL Server Installer at $MEDIA on $hn"
      $tran = ""
      Try{
       & $MEDIA\setup.exe /ACTION=$ACTION /Q /FEATURES=$FEATURES /IACCEPTSQLSERVERLICENSETERMS /UPDATEENABLED=False /INSTALLSHAREDDIR="$INSTALLDIR\Program Files\Microsoft SQL Server" /INSTALLSHAREDWOWDIR="$INSTALLDIR\Program Files
    (x86)\Microsoft SQL Server" /RSINSTALLMODE="FilesOnlyMode" /INSTANCEID="$INSTANCEID" /INSTANCENAME="$INSTANCENAME" /INSTANCEDIR="$INSTALLDIR\Program Files\Microsoft SQL Server" /ENU="True" /AGTSVCSTARTUPTYPE="Automatic"
    /SQLSVCSTARTUPTYPE="Automatic" /NPENABLED=1 /TCPENABLED=1 /RSSVCStartupType="Automatic" /ERRORREPORTING=0 /SQMREPORTING=0 /INDICATEPROGRESS /INSTALLSQLDATADIR="$SQLDATADRIVE\DATA" /SQLUSERDBDIR="$SQLDATADRIVE\DATA" /SQLUSERDBLOGDIR="$SQLLOGDRIVE\LOG"
    /ASDATADIR="$SQLDATADRIVE\OLAP\DATA" /ASLOGDIR="$SQLLOGDRIVE\OLAP\Log" \ASBACKUPDIR="$SQLDATADRIVE\OLAP\Backup" \ASTEMPDIR="$SQLDATADRIVE\OLAP\Temp" /ASCONFIGDIR="$SQLDATADRIVE\OLAP\Config" /ASCOLLATION="Latin1_General_CI_AS"
    /SQLCOLLATION="SQL_Latin1_General_CP1_CS_AS" /SQLSVCACCOUNT="$DOMAIN\$SQLSERVERSERVICEUSER" /SQLSVCPASSWORD="$SQLSERVICEPASSWORD" /AGTSVCACCOUNT="$DOMAIN\$SQLSERVERSERVICEUSER" /AGTSVCPASSWORD="$SQLSERVICEPASSWORD"
    /ASSVCACCOUNT="$DOMAIN\$SQLSERVERSERVICEUSER" /ASSVCPASSWORD="$SQLSERVICEPASSWORD" /RSSVCACCOUNT="$DOMAIN\$SQLSERVERSERVICEUSER" /RSSVCPASSWORD="$SQLSERVICEPASSWORD" /FTSVCACCOUNT="NT AUTHORITY\LOCAL SERVICE"
    /INDICATEPROGRESS > $out
      } Catch [System.Exception] {
       return 0,$_.Exception.ToString()
      if ($tran -ne ""){
       $out += $tran
      return 1,$out
    The media resides on the server that I am remoting to in powershell and the server is on the same domain. The credentials I pass are for a Domain Admin, but SQL Server fails to validate the credentials for the passed parameter for the sql service user with
    a Access Denied.
    If I run the same command with the same user directly on the server it works fine.
    My guess is that the elavated privs for Administrator are not being set when using Invoke-Command? Is there a way to utilize powershell to install SQL Server 2012 with command line option using the invoke-command and passing credentials? Or is this a limitation
    to the SQL Server installer. If there is can a example be provided?

    Ok, so with the help of some friends, we found a fix that works!
    Prior to running the Invoke-Command I now run:
    # enable CredSSP on a client computer; this command allows the client credentials to be delegated to the server01 computer.:
    Enable-WsManCredSSP -Role Client -DelefateComputer server.some.domain.com
    Then I add the -Authentication option to my Invoke-Command with option Credssp.
    The install the works fine. Hope this helpes all.

  • Change computer name using partial serial number

    I'm starting to learn Powershell and I'm stuck trying to automate a computer name change. The code below works to rename the computer and reboot but I would like to shorten it and I'm not sure how. The serial number is 15 characters which makes the computer
    name with the prefix added 18 charactes long. How can I modify it so that it takes the last 10 of the serial number plus the prefix? We are using Powershell 4.
    The script changes the name to something like MCT1234567890ABCDE
    What I would like is MCT67890ABCDE
    $serial = Get-WmiObject win32_bios | select -expand serialnumber
    $newname = "MCT" + $serial
    Rename-Computer -NewName $newname -Force -Restart

    Hi,
    The serial number is 15 characters which makes the computer name with the prefix added 18 charactes long.
    You might run into problems with this, considering there's a 15 character limit on NetBIOS names:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/4fe7b148-a01f-498f-a88a-06aef3edd81e/what-is-the-maximum-length-of-a-computer-name-in-windows?forum=winservergen
    http://support.microsoft.com/kb/909264/en-us
    Just something to be aware of.
    Don't retire TechNet! -
    (Don't give up yet - 12,575+ strong and growing)

  • Is it possible to add a PC to a domain via a remote CLI using Powershell?

    If this is going into a domain, which it sounds to be the case, you'll be using a specified base image as per your company policy (image A goes to computer build A group). If you are using SCCM, FOG, etc... A better method would be to put in a task sequence to integrate the machine, at the end of the sequence of course. Don't want GPOs and firewall settings coming up before everything is complete. This would also allow you to automate the process, rather than push it manually.

    I saw an instructional video from "Eli the Computer Guy" about adding Windows 8.1 PC's to a Server 2012 Domain. He did it via the GUI which is what I am very comfortable with, but I would love to be able to do this via a remote command line using Powershell, is this possible? Let's say my Workgroup is ABC and the Domain I'd like to join the PC to is BCORPINC
    Thank you
    This topic first appeared in the Spiceworks Community

  • Get Remote Desktop access logs using PowerShell

    How to find all login/Logout/Reconnect and other log information from a remote computer using powershell
    This should also include from which client/machine (including which account) that connection has established.
    may be more in brief, like a RDP historical log, i.e., who all logged and performed what from startdate to enddate.
    Suresh Kumar Udatha.

    You would have to write a script to remotely query the Event log for all logon types required.  You would also need to write custom record data extractors for each log message type.
    I recommend starting in the Gallery and looking for scripts that query the windows event logs.  THis will show you the basics of event log reporting using PowerShell.
    What you are asking is a very large project.  The records you need are different fro different OSs.  Pre-Vista uses the old format and event IDs. Vista and later use a newer format.
    Security log performing is a specialized industry.  There are many companies that produce tools to do this.  I recommend looking into purchasing this tool.
    It can be written in PowerShell. I have written many event log extraction scripts.  It will take you quites some time to do as many record types as you aare asking for.
    ¯\_(ツ)_/¯

  • Changing a SQL Report server Database to a new One Using Powershell script

    Hi,
    I have an existing report server (Native Mode) and a pre-configured report server database. I have created a new database and want to assign it new report server database. How can i automate this process using powershell?
    Here is the detail requirement
    If there is a Report Server database seeded on the xxxxx server, follow the below steps:
    ◾Click the Database button on the left. Click on the Change Database button, choose option Choose an existing report server database. Enter the RPT server name (e.g. xxxxxx) in Server Name text box and click Next.
    ◾In the Report Server Database selection, select the ReportServer database. Then click next button to complete the process.
    Any help in this regard will be very much helpfull.
    Sushruta Banerjee

    Hi Sushruta,
    To query export from Report server Database, the scripts below may be helpful for you:
    Export RDL Files from ReportServer Database with PowerShell
    SQL Database Reports with PowerShell
    I hope this helps.

  • You can download past purchases on this computer with just one Apple ID every 90 days. This computer can be used with a different Apple ID in 60 days. This is the message I get when trying to view purchased material!  My ID hasn't changed!

    I can't pull up purchased content without this - You can download past purchases on this computer with just one Apple ID every 90 days. This computer can be used with a different Apple ID in 60 days. - my ID hasn't changed

    You can use multiple AppleIDs to purchase new music but you are limited as to how frequently you can change authorizations for re-downloading  past purchases.  It may well be a measure to deter piracy by stopping a group of people from going around to a friend's computer and downloading purchases on the other person's computer.  It is easy to avoid by making sure you have backup copies on drives at home so you never need to redownload anything.

Maybe you are looking for

  • Trying to update iphone 4 to IOS 7 says i need to update itunes and its already updated

    Im trying to update my Iphone 4 to IOS 7 and it keeps telling me I need to update my Itunes I have the most current version of Itunes and that is as far as my update will take me...how do I get past this??

  • Since installing 10.6.4 problem with transparent Dock icons

    Hi there; I installed the Mac OS X 10.6.4 update via Software Update on three Macs. So far, so good on two of them. On my MacBook Pro, 10.6.4 is running fine except for a small but annoying problem. Some of the icons in the Dock are transparent now.

  • Forum-specific search functions don't work

    The search function on this site doesn't seem to work properly. If I try to do a search on a specific forum via the 'Only this forum" function on the right side of the page (which doesn't seem to appear on every forum) or by selecting 'More options'

  • [Desktop][Running] Running Spotify Application in the Background...

    Think it would be very convenient if we could run the Spotify application in the background. I remember it used to be an option under "Edit>Preferences..." before a certain update removed it... O.o

  • Photos crashes Mac

    When I export a photo from Photos to my desktop and then try to open the photo in Preview, my mac crashes, requiring a hard reboot.  Same thing happens if I try to mail the photo.  Has anyone else had this problem?