Turnoff a virtual server using PowerShell

Hi
I have a Server 2012 with Hyper-V on it.
I need to shutdown all machines but an ORDERLY shutdown, not just turnoff.
the host is not a member of the domain but of a workgroup, all VM are Domain members...
Does anyone have an example script to give me?
Thank you!
Moriya Saadon

Hi Moriya,
>>I don`t need to login myself and shut down the system manually...?
Yes , in task scheduler you can configure it :
Best Regards,
Elton Ji
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] .

Similar Messages

  • Install SQL server using powershell

    Hi Team,
    Greetings!!!
    I want to install SQL server using powershell.
    Please guide me how can I install SQL server using powershell.
    I am trying to install using the command :  " Invoke-Item SQLIPAK /AS /QFE:11.0.3393 //SQLADMIN:REDMOND\PSITADM /CLEANMSDB /NOLOGCOPY /AUTOTEMPFILES /PREVIEW"
    But it is throwing error as:
    Invoke-Item : A positional parameter cannot be found that accepts argument '/AS'.
    At line:1 char:1
    + Invoke-Item SQLIPAK.exe /AS /QFE:11.0.3393 //SQLADMIN:REDMOND\PSITADM /CLEANMSDB ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Invoke-Item], ParameterBindingException
        + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.InvokeItemCommand

    Hello,
    Ref to links
    http://msdn.microsoft.com/en-us/library/ms144259.aspx
    http://www.mssqltips.com/sqlservertip/2707/installing-sql-server-2012-on-windows-server-core-using-powershell/
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Blue screen error after converting physical to virtual server using disk2vhd

    I have used the sysinternals disk2vhd to create the c: drive from a Dell server. I was able to create a virtual server and boot but had licensing issues. After a support call and doing a repair install to change licensing I am now getting a: "a process or
    thread crucial to system operation has unexpectedly exited or been terminated" after the virtual machine boots and I log on. I tried to get the integration services installed but the server wouldn't stay running long enough.
    Any suggestions for resolution would be appreciated.

    Hi,
    Have you tried the suggestion? I want to see if the information provided was helpful. Your feedback is very useful
    for the further research. Please feel free to let me know if you have addition questions.
    Best regards,
    Vincent Hu

  • Configuring virtual server using iplanet.

    is it possible to have a virtual server which do not have an entry in DNS server but have entry in etc/host file?
    i am using iplanet for configuring a virtual server

    The inbound port is the port that is used on the Internet side. It is the port that the outside world will use when accessing your service.
    The private port is the port that the router sends it to on your local network. It is the port where your computer is expecting the information.
    Many times you will set both ports to the same value.

  • Get the connected users count from sql server using powershell

    Hi,
    I am working on SharePoint 2013,I am having SQL server 2012.
    I want to get the Connected Users count from  sql server using power shell.
    Can any one please let me know how to implement.
    Thanks in advance.
    Regards,
    Phani Kumar R

    Sorry Tom, I dont like to hear "There is no way" :-(
    There is always a way in computer to get what you need (at least it is good as Rule of thumb). I am not sure we will find it here (in a voluntary supporting forum).
    Now we (or better the architect of their system) should think of the way :-)
    Of course doing so in the forum, while we do know the system and only got a glimpse on what is needed, is not the best idea. I will point some issues which can be related to a solution. Those are not a solotions as it is but something we can use for a solution
    once something look in the right way.
    * A web connects counter is one of the easier thing to do. The basic idea is just to use the connect event and the disconnect event an adding 1 or removing 1 from the counter. This is best to do in the application using static variable as any way the second
    the application is down the counter can be go to hell as we know there is no one connect (there for a counter do not use database usually). Using a web dot-net (or asp 3) application this is done most of the time using the global.asa/global.asax file, which
    include the application and session events. for example using the method Session_Start
    protected void Session_Start(object sender, EventArgs e) {
    // Code that runs when a new session is started
    * IIS have a build-in loging system where we can log each and every request/response or only logins users. There is lot we can do with this log files including data mining. Using small bulk insert script we can use the SQL agent to insert those logs to the
    database and get the information we need.
    * any web developer i want to believe know about the Fiddler application which we use to monitor traffic. A proxy is not the only way to to monitor traffic (it is not good for our case as this is in the client side), there are several option in the server
    side.
    * SQL trigger on logon can be use to get information on who is loging on and can be logging only specific source (like our sharepoint IP or any sharepoint application). This information (what is the application which connect to the server can be retrive
    in several solution without using a trigger as well)
    *** (I'll be brief ... I'm getting bored... probably the reader feel the same)
    * using extended events and/or profiler we can monitor any connection and save the data or just remember it in shared (static) variable (this
    blog show how to do it by the way). Again we can monitor specific application or use any filter in order to get only the sharepoint users
    .... and i can continue for several days more :-) ...
    "If there is a willing, then there's a way"
    "If you can't do it, Then someone else probably can"
    "Never say never"
    I hope this help somehow :-)
    [Personal Site] [Blog] [Facebook]

  • Create SharePoint 2010 Search Service Application Using Powershell

    Hi Team,
    Could you please assist me in completing the search service application for
    two server using powershell. Both the servers will be running all the component
    Version SharePoint 2010
    # 1.Setting up some initial variables.
    write-host 1.Setting up some initial variables.
    $SSAName = "Search Service Application"
    $SVCAcct = "Domain\ServiceAccount"
    $SearchAppPoolName ="DefaultAppPool"
    $SSI = get-spenterprisesearchserviceinstance -local
    $err = $null
    $SSADBName="Search_AdminDB"
    $SSADBServer="DBServer"
    $host1="Server1"
    $host2="Server2"
    # Start Services search services for SSI
    write-host Start Services search services for SSI
    Start-SPEnterpriseSearchServiceInstance -Identity $SSI
    # 2.Create an Application Pool.
    write-host 2.Create an Application Pool.
    #$AppPool = new-SPServiceApplicationPool -name $SSAName"-AppPool" -account $SVCAcct
    $AppPool = Get-SPServiceApplicationPool -Identity $SearchAppPoolName -ErrorAction SilentlyContinue
    # 3.Create the SearchApplication and set it to a variable
    write-host 3.Create the SearchApplication and set it to a variable
    $SearchApp = New-SPEnterpriseSearchServiceApplication -DatabaseServer $SSADBServer -Name $SSAName -applicationpool $AppPool -databasename $SSADBName
    #4 Create search service application proxy
    write-host 4 Create search service application proxy
    $SSAProxy = new-spenterprisesearchserviceapplicationproxy -name $SSAName"ApplicationProxy" -Uri $SearchApp.Uri.AbsoluteURI
    # 5.Provision Search Admin Component.
    write-host 5.Provision Search Admin Component.
    set-SPenterprisesearchadministrationcomponent -searchapplication $SearchApp -searchserviceinstance $SSI
    # 6.Create a new Crawl Topology.
    write-host 6.Create a new Crawl Topology.
    $CrawlTopo = $SearchApp | New-SPEnterpriseSearchCrawlTopology
    New-SPEnterpriseSearchCrawlComponent -SearchTopology $newTopology -SearchServiceInstance $hostA
    Source:blog.MSDN Author- Russ Maxwell
    Thanks Basva

    Could you please assist me in completing the search service application for
    two server using powershell. Both the servers will be running all the component 
    Hi Basva,
    Do you want to provision two search service applications in single farm?
    Commonly, only one search service application is needed in a farm for Search function.
    Here are articles for detail information about how to provision search service application using powershell:
    http://blogs.msdn.com/b/jjameson/archive/2011/02/28/powershell-script-to-configure-search-in-sharepoint-server-2010.aspx
    http://blogs.msdn.com/b/russmax/archive/2009/10/20/sharepoint-2010-configuring-search-service-application-using-powershell.aspx
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Virtual server and client command

    Hi,
    I want to configure firewall load balancing as follows. I have 3 firewalls, FW1, FW2, FW3. I want to create a serverfarm for each FW, i.e. FW1 in SF1, FW2 in SF2, and FW3 in SF3. Then, we'd like to create two Virtual server VS1 and VS2. Each Virtual server has Server Farm SF2 as a backup server farm. I.e. SF1 is the active server farm for VS1, and SF2 is the backup server farm for VS1. We also have SF3 is the active server farm for VS2, and SF2 is the backup server farm for VS3. Note that all connections to VS1 and VS2 will come from the same VLAN (e.g. VLAN X). So the configuration of the virtual server I think should be as follows ;
    vserver VS1
    virtual 0.0.0.0 0.0.0.0 25
    client 192.168.1.0 255.255.255.0
    vserver VS2
    virtual 0.0.0.0 0.0.0.0 25
    client 192.168.2.0 255.255.255.0
    So, the question I have is, will this work if we filter who can access the virtual server using the client commmand ? I.e. clients coming from 192.168.1.0 will be using VS1 and clients coming from 192.168.2.0 will be using VS2.
    Thanks !

    The 'client' command should work as you expect.
    You'll need to add the 'serverfarm' command under each vserver. Ex:
    serverfarm SF1
    real 1.1.1.1
    serverfarm SF2
    real 2.2.2.2
    serverfarm SF3
    real 3.3.3.3
    vserver VS1
    virtual 0.0.0.0 0.0.0.0 tcp 25
    serverfarm SF1 backup SF2
    client 192.168.1.0 255.255.255.0
    vserver VS2
    virtual 0.0.0.0 0.0.0.0 tcp 25
    serverfarm SF3 backup SF2
    client 192.168.2.0 255.255.255.0
    I am assuming that you will be using different IP addresses for each vserver. Is that correct?
    ~Zach

  • Conversion from physical to virtual server

    Our server technology group wants to convert our physical
    server that contains the RoboEngine to a virtual server (using ESX
    VMware). We are using RoboHelp 5 to publish WebHelp to the
    RoboEngine. Has anyone else converted from a physical to a virtual
    server? If so, could you tell me about any problems you
    encountered?
    Thanks,
    Liz

    Hello Nelson, 
    There are quite lot of things in TMG which are dependent on Hardware.
    If you want to migrate from physical to virtual server, you can follow the steps here which are recommended/supported way of doing it.
    Though this article is for ISA to TMG migration, still you can follow the same steps for Physcial to Virtual migration.
    http://technet.microsoft.com/en-us/library/dd440994.aspx
    Please let us know, how it goes!

  • App Server 9 - virtual server listener

    Problem - getting 'Already bound: 80' if virtual server using 2 IP's
    Yes, I know the answer to the question is...
    There MUST be something else bound to port 80 - but there ISN'T.
    Pretty 'basic' stuff. But, after 2 days work, I am
    unable to configure with 2 different IP's - I know it
    'should work' - but curious if anyone can confirm it DOES work?
    fresh install OS & Application Server
    Sparc Solars 11/06, Sun V210
    Java Aplication Platform SDK-5 Update 3
    DNS: (x's are valid IP address)
    x.x.x.34 -> web30.domainabc.com - machine primary IP bge0
    x.x.x.35 -> www.domaindef.com - 2nd IP bge0:1
    ======== WORKS ==== (listens to all IP's)
    listeners...
    admin-listener true 0.0.0.0 8444 __asadmin
    http-listener-2 true 0.0.0.0 443 server
    http-listener-1 true 0.0.0.0 80 server
    virtual servers...
    server http-listener-1,http-listener-2
    __asaadmin admin-listener
    domaindef http-listener-1
    ======== DOES NOT WORK ====
    listeners...
    admin-listener true x.x.x.34 8444 __asadmin
    http-listener-2 true 0.0.0.0 443 server
    http-listener-1 true x.x.x.34 80 server
    http-domaindef true x.x.x.35 80 domaindef
    virtual servers...
    server http-listener-1,http-listener-2
    __asaadmin admin-listener
    domaindef http-domaindef
    netstat -a ONLY shows domainabc.com using port 80
    NOTHING else is using port 80
    Server will not restart - server log shows:
    grizzlyHttpProtocol.endpoint.initerror
    java.net.BindException: Already bound: 80
    WHILE in Admin, if 'Enable' listener http-domaindef
    it WORKS - but netstat shows the server 'clobbered' the x.x.x.34:80
    and is only running the x.x.x.35:80 listener instead
    [#|2007-04-16T17:09:44.261-0400|SEVERE|sun-appserver9.1|org.apache.catalina.core.StandardService|_ThreadID=22;_ThreadName=httpWorkerThread-8444-1;_RequestID=ea8003f3-d4df-40bd-a403-558f4f6928a2;|Connector.initialize
    LifecycleException: PWC3985: Protocol handler initialization failed: java.net.BindException: Already bound: 80
    at org.apache.coyote.tomcat5.CoyoteConnector.initialize(CoyoteConnector.java:1592)

    You are mixing version.
    EJB 2.0 is part of J2EE 1.3.
    EJB 2.1 is part of J2EE 1.4.
    Oracle Application Server 9.0.4 supports J2EE 1.3
    There is also a preview of the J2EE 1.4 version.
    Both can be found here:
    http://www.oracle.com/technology/tech/java/oc4j/index.html

  • Virtual server already has a web module loaded at [/]

    I have a EAR file called foo.ear
    foo.ear contains bar.war
    In the application.xml file, I set the context root for bar.war
    <module id="abc">
    <web>
    <web-uri>bar.war</web-uri>
    <context-root>/</context-root>
    </web>
    </module>
    When I deploy this EAR into Sun Java System Application Server 8.0 Update 1 (Platform Edition),
    I get this error:
    [#|2004-06-18T11:11:47.219-0700|WARNING|sun-appserver-pe8.0.0_01|javax.enterprise.system.container.web|_ThreadID=14;|WEB0113: Virtual server [server] already has a web module loaded at []; therefore web module [foo:bar.war] cannot be loaded at this context path on this virtual server. |#]
    How do I fix this? Why is the virtual server using the "/" path?
    I want to give "/" to bar.war
    Thanks in advance,
    -Sean

    You may want to read through this thread ( http://forum.java.sun.com/thread.jsp?forum=136&thread=529445 ) also.
    It has detailed instructions on how to do something similar to your request.
    vbk

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

  • How to add a certificate to IIS global "Server Certificates" list using PowerShell?

    Hi, been surfing the web for an example on how to add a certificate to the "global" IIS "Server Certificates" list using PowerShell but to no luck. I already have code in place on how to tie / associate a specific website with a specific cert but not how
    to add the new .cer file using the "Complete Certificate Request..." wizard using PowerShell.... I dont expect the final code to become published but if someone had an idea on howto integrate / get an entry point on where to interact between the "Server Certificate"
    list in IIS and POSH I would be super happy! :|
    I am runnign IIS on a Windows 2008R2 x64 Standard Edition if that helps..... of course, I would saddle for an CLI if there is no other way, but POSH is of course the way to go! :)
    Thanks for the help in advance guys, take care!
    br4tt3

    Hi and thanks for the suggestions!
    Although it comes close, the suggested code example points on howto import / incorporate .pfx files - I am getting fed by .cer files which I need to add into the IIS console using POSH.
    I tried explore the IIS.CertObj object but was not able to work out if this one could be used for importing / adding .cer files into IIS! However, launching the following command from a POSH console with Import-Module Webadministration already
    loaded into that shell;
    $certMgr = New-Object -ComObject IIS.CertObj returns the following error message:
    New-Object : Cannot load COM type IIS.CertObj
    From an IIS perspective I have the following components installed;
    [X] Web Server (IIS)                                    Web-Server
        [X] Web Server                                      Web-WebServer
            [ ] Common HTTP Features                        Web-Common-Http
                [ ] Static Content                          Web-Static-Content
                [ ] Default Document                        Web-Default-Doc
                [ ] Directory Browsing                      Web-Dir-Browsing
                [ ] HTTP Errors                             Web-Http-Errors
                [ ] HTTP Redirection                        Web-Http-Redirect
                [ ] WebDAV Publishing                       Web-DAV-Publishing
            [X] Application Development                     Web-App-Dev
                [ ] ASP.NET                                
    Web-Asp-Net
                [X] .NET Extensibility                      Web-Net-Ext
                [ ] ASP                                    
    Web-ASP
                [ ] CGI                                    
    Web-CGI
                [ ] ISAPI Extensions                        Web-ISAPI-Ext
                [ ] ISAPI Filters                           Web-ISAPI-Filter
                [ ] Server Side Includes                    Web-Includes
            [ ] Health and Diagnostics                      Web-Health
                [ ] HTTP Logging                            Web-Http-Logging
                [ ] Logging Tools                           Web-Log-Libraries
                [ ] Request Monitor                         Web-Request-Monitor
                [ ] Tracing                                
    Web-Http-Tracing
                [ ] Custom Logging                          Web-Custom-Logging
                [ ] ODBC Logging                            Web-ODBC-Logging
            [X] Security                                   
    Web-Security
                [ ] Basic Authentication                    Web-Basic-Auth
                [ ] Windows Authentication                  Web-Windows-Auth
                [ ] Digest Authentication                   Web-Digest-Auth
                [ ] Client Certificate Mapping Authentic... Web-Client-Auth
                [ ] IIS Client Certificate Mapping Authe... Web-Cert-Auth
                [ ] URL Authorization                       Web-Url-Auth
                [X] Request Filtering                       Web-Filtering
                [ ] IP and Domain Restrictions              Web-IP-Security
            [ ] Performance                                 Web-Performance
                [ ] Static Content Compression              Web-Stat-Compression
                [ ] Dynamic Content Compression             Web-Dyn-Compression
        [X] Management Tools                                Web-Mgmt-Tools
            [X] IIS Management Console                      Web-Mgmt-Console
            [X] IIS Management Scripts and Tools            Web-Scripting-Tools
            [ ] Management Service                          Web-Mgmt-Service
            [ ] IIS 6 Management Compatibility              Web-Mgmt-Compat
                [ ] IIS 6 Metabase Compatibility            Web-Metabase
                [ ] IIS 6 WMI Compatibility                 Web-WMI
                [ ] IIS 6 Scripting Tools                   Web-Lgcy-Scripting
                [ ] IIS 6 Management Console                Web-Lgcy-Mgmt-Console
        [X] FTP Server                                      Web-Ftp-Server
            [X] FTP Service                                 Web-Ftp-Service
            [X] FTP Extensibility                           Web-Ftp-Ext
        [ ] IIS Hostable Web Core                           Web-WHC
    More or less the one thing that I am trying to get up and running is an automated FTPS solution - I just use the IIS console to be able to troubleshoot / compare how things scripted from POSH interacts in the MMC representation. The error I am getting
    might be that I am lacking some IIS components to be in place to be able to automate some parts of the IIS - as suggested by the IIS.CertObj object listed in the example..... I will get back if I can track down which component needs to be added to be
    able to reference the IIS.CertObj object.
    Br4tt3 signing out...
    br4tt3

  • How can I find what scom group a specific server belongs to using powershell?

    Environment:  SCOM 2007 r2
    Server in question:  Running Windows 2003 Std. (yes I know this sounds crazy)
    Why do I need this:  I noticed at the console level we have had server unexpected shutdown events which are not generating email notifications. 
    Source shows: Windows 2003 Server Standard Edition
    Alert Rule:  Windows Shutdown Unexpectedly
    From what I see these are all windows 2003 server Std edition systems.  I did a track and trace using our exchange tracking system which confirmed the alerts were not being emailed. Not sure if there is a better approach for this, but not being a sql
    expert (however I do have someone I can leverage) I am trying to see if I can somehow extract this information using powershell.
    Secondary general question:  How can I find out the current size of our scom 2007 database and the number of objkects\servers being monitored? This is prep work for a migration over to 2012.
    Thanks in advance for the help!

    1. what scom group a specific server belongs to
    function Get-GroupNames {
     [cmdletbinding()]
     param($computerFQDN)
     $containmentRel = Get-RelationshipClass -name:’Microsoft.SystemCenter.InstanceGroupContainsEntities’
    $computerClass = Get-MonitoringClass -name:”Microsoft.Windows.Computer”
    $criteria = [string]::Format(“PrincipalName = ‘{0}’”,$computerFQDN)
     try {
     $computer = Get-MonitoringObject -monitoringClass:$computerClass -criteria:$criteria
     $relatedObjects = $computer.GetMonitoringRelationshipObjectsWhereTarget($containmentRel,[Microsoft.EnterpriseManagement.Configuration.DerivedClassTraversalDepth]::Recursive,[Microsoft.EnterpriseManagement.Common.TraversalDepth]::Recursive)
     catch {
     $_
     write-host “An error occurred while querying groups of $computerFQDN”
    foreach($group in $relatedObjects)
     [array]$Groups = $groups + $group.SourceMonitoringObject.DisplayName
     if($groups) {
     return $groups
     } else {
     write-host “No groups available for $computerFQDN”
    Usage:
     Get-GroupName -ComputerFQDN myserver1
    for detail, pls. refer to
    http://techibee.com/powershell/powershell-get-scom-groups-of-a-computer-account/1129
    Roger

  • How do i install mysql on windows server 2012 r2 using powershell(automate)??

    i have a requirement of installing the mysql server with one click deployment using power shell by passing the parameters needed into the mysql console. can i achieve that ?
    can  anyone help me in doing that?
    thanks in advance.
    Suresh Gaddam

    Hi Suresh,
    This forum is for SCOM related questions, it seems like that you are asking for powershell script to install Mysql. From my point of view, I don't think that using powershell to install Mysql is an easy way, as it is hard to say whether Powershell can get
    information from Mysql install console with some API.
    In addition, for further assistance, please contact MySQL forum and Powershell forum.
    Thanks for your understanding!
    Regards,
    Yan Li
    Regards, Yan Li

  • Is it possible to use Powershell to determine if Windows Server Source Files are present on disk?

    Hi everyone,
    I would like to know if it is possible to use a Powershell cmdlet to determine if Windows Server 2012 (R2) Source Files are present on disk.
    We are using an automated PS script to install roles and features and some registry keys and applications afterwards. If the Source Files are not present, the script will fail, so I would like a# Check if Source Files are present # stage built in
    the script to determine if the source files are present or that an alternate source path needs to be used.
    Is this possible with Powershell and if so, how can we achieve this?
    I'll appreciate your answer.
    - Rob

    Hi Rob,
    I assume that you are using powershell command "install-windowsfeature" .
    I would suggest you add the parameter "-source" to specify the alternate path of thesource file .
    " The path specified in this parameter is only used if the command cannot find feature files in the local side-by-side store of the specified target computer or VHD. "
    For details please refer to the article below :
    https://technet.microsoft.com/en-us/library/jj205467(v=wps.620).aspx
    Best Regards,
    Elton Ji
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] .

Maybe you are looking for