Managing from Powershell 4 machines with Powershell 2 (WinRM)

Hi,
is it possible to manage machines which have powershell 2 installed from a machine with powershell 4?
Background: I plan to write a script running in powershell 4 and like to query servers with have either powershell 2 or powershell 4 installed.
Is that possible? Is there something I need to consider?
Thanks for your feedback
Ruben

You cannot get scheduling from WMI.
You do not need WinRM to use WMI.  WF does not necessrilu use WInRM.  These are all separate technologies in WIndows that just happen to be available to PowerShell.
Start by learning how Windows works and what all of these technologies do.
You cannot guess your way through any of this.  Without good fundamtentals in WIndows technologies you will not be able to understand the lessons or discussions.
Here is a blog that has many good backgrounders and examples:
https://social.technet.microsoft.com/Search/en-US?query=workflow&rn=Hey,%20Scripting%20Guy!%20Blog&rq=site:blogs.technet.com/b/heyscriptingguy/&beta=0&ac=2
¯\_(ツ)_/¯

Similar Messages

  • How to call 7Zip's file manager from Powershell?

    Hello,
    I need to call 7zip's file manager to extract some files. Did anybody try this before?
    I appreciate any suggestions.

    Not sure what you mean by "call 7Zip's file manager."
    But you can run the 7z.exe program from the PowerShell command line just fine; e.g.:
    PS C:\> & "C:\Program Files\7-Zip\7z.exe" x "C:\Test Files\Test File.zip"
    -- Bill Stewart [Bill_Stewart]

  • WLS61-WinNT:  Admin/Managed servers on same machine with NodeManager?

    Hi,
    I'm trying to set up a development environment with a Admin server
    that controls at least one Managed server. I can start the Admin
    server (7001) successfully, and "startNodeManager" seems to work fine
    on the default port 5555. No clustering is being done. Only
    DefaultWebApp is available.
    I'm starting "setEnv" and "startWebLogic" from
    C:\dev\bea\wlserver6.1\config\devdomain
    and "startNodeManager" from
    C:\dev\bea\wlserver6.1\config
    I have a Machine, "devmachine", assigned to port 5555 (thus attaching
    it to the NodeManager) using the default config files.
    I have 2 Servers created:
    "adminserver", which listens on port 7001 (no great surprise), and
    "devserver", which listens on port 7011. I have also tried
    "devserver" on port 5555.
    DefaultWebApp has chosen both Servers.
    When I go to the Console, right-click on "devserver", and select
    "Start this server...", I get the "Are you sure?" page.
    Clicking "Yes", I get messages on the "startNodeManager" console:
    <Date><Info><Nodemanager@localhost:5555><WindowsProcessControl: online
    successfully invoked on server 'devserver', pid: 488>
    This sounds good, but the console browser returns:
    java.lang.NoClassDefFoundError: weblogic/Server
    Exception in thread "main"
    <Date><Info><Nodemanager@localhost:5555><WindowsProcessControl: online
    successfully invoked on server 'devserver', pid: 488>
    StartNodeManager's output confirms that "weblogic.jar" is in the
    classpath.
    It's location is: .\lib\weblogic.jar
    Clicking on the Servers branch confirms that 'devserver:7011' is not
    running, and that 'adminserver:7001' is running.
    I believe that I'm making some sort of simple configuration error, but
    I have been unable to find any documentation that clarifies this
    problem.
    Has anyone gotten this Admin/Managed combination to work on 1 physical
    machine? If so, am I simply not matching ports in the config.xml file
    correctly? Am I missing something obvious?
    Many Thanks!
    Jeff

    Hi,
    It may not be obvious, but a clean install seemed to solve it. A
    wacky config issue? The world may never know...or care. :>
    Jeff
    [email protected] (Jeff Murdoch) wrote in message news:<[email protected]>...
    Hi,
    I'm trying to set up a development environment with a Admin server
    that controls at least one Managed server. I can start the Admin
    server (7001) successfully, and "startNodeManager" seems to work fine
    on the default port 5555. No clustering is being done. Only
    DefaultWebApp is available.
    I'm starting "setEnv" and "startWebLogic" from
    C:\dev\bea\wlserver6.1\config\devdomain
    and "startNodeManager" from
    C:\dev\bea\wlserver6.1\config
    I have a Machine, "devmachine", assigned to port 5555 (thus attaching
    it to the NodeManager) using the default config files.
    I have 2 Servers created:
    "adminserver", which listens on port 7001 (no great surprise), and
    "devserver", which listens on port 7011. I have also tried
    "devserver" on port 5555.
    DefaultWebApp has chosen both Servers.
    When I go to the Console, right-click on "devserver", and select
    "Start this server...", I get the "Are you sure?" page.
    Clicking "Yes", I get messages on the "startNodeManager" console:
    <Date><Info><Nodemanager@localhost:5555><WindowsProcessControl: online
    successfully invoked on server 'devserver', pid: 488>
    This sounds good, but the console browser returns:
    java.lang.NoClassDefFoundError: weblogic/Server
    Exception in thread "main"
    <Date><Info><Nodemanager@localhost:5555><WindowsProcessControl: online
    successfully invoked on server 'devserver', pid: 488>
    StartNodeManager's output confirms that "weblogic.jar" is in the
    classpath.
    It's location is: .\lib\weblogic.jar
    Clicking on the Servers branch confirms that 'devserver:7011' is not
    running, and that 'adminserver:7001' is running.
    I believe that I'm making some sort of simple configuration error, but
    I have been unable to find any documentation that clarifies this
    problem.
    Has anyone gotten this Admin/Managed combination to work on 1 physical
    machine? If so, am I simply not matching ports in the config.xml file
    correctly? Am I missing something obvious?
    Many Thanks!
    Jeff

  • Start managed server in multihomed machine with cluster?

    Hi,
              I have problems with starting a remote managed server.
              I have a cluster configured with 2 managed servers in the same machine. I added a new managed server but assigned to other machine.
              MachineA:
              -AdminServer:7001,
              -ManagedServerA1: 7004, ManagedServerA2:7006
              -Cluster
              MachineB:
              -ManagedServerB: 7003
              I tried to start ManagedServerB in Machine A but I have got this error:
              startManagedWeblogic.cmd ManagedServerB http://MachineA:7001
              <Error> <Server> <BEA-002606> <Unable to create a server socket for listening on channel "Default". The address “IP of MachineB that I am using” might be incorrect or another process is using port 7003: java.net.BindException: Cannot assign requested address: JVM_Bind.>
              <Emergency> <Security> <BEA-090087> <Server failed to bind to the configured Admin port. The port may already be used by another process.>
              But the port is not used by any other process or server.
              Other question: is it necessary to start all managed servers, local and remote in the server where my application is deployed?
              Is it the correct way for using a cluster in multihomed machine?
              Is there any documentation for configuring a cluster specifically for this case?
              By the way, I am using Weblogic 91.
              Regards,
              Hicyo

    Hi,
              I am also having the same problem below.Can someone suggest a solution to my problem?
              I have a cluster configured with 2 managed servers in the same machine. I added a new managed server but assigned to other machine.
              MachineA:
              -AdminServer:7001,
              -ManagedServerA1: 7004, ManagedServerA2:7006
              -Cluster
              MachineB:
              -ManagedServerB: 7003
              I tried to start ManagedServerB in Machine A but I have got this error:
              startManagedWeblogic.cmd ManagedServerB http://MachineA:7001
              <Error> <Server> <BEA-002606> <Unable to create a server socket for listening on channel "Default". The address “IP of MachineB that I am using” might be incorrect or another process is using port 7003: java.net.BindException: Cannot assign requested address: JVM_Bind.>
              <Emergency> <Security> <BEA-090087> <Server failed to bind to the configured Admin port. The port may already be used by another process.>
              But the port is not used by any other process or server.

  • Managing several groups of machines with Sun update manager.

    I have tested the Update Connection with a few machines for a while
    and it seems ok, but if I were to move all my machines to using Update Manager then I would need some sort of grouping similar machines together.
    Now it looks to me that everything is one big list.
    Is there any way to organize machines so test and production is not in the same long list and perhaps servers and desktops are separated? If not I guess I am not the only one missing such a feature..
    Best regards,
    Thomas

    Thomas,
    Assuming you are referring to the systems and how they are grouped/displayed on the Update Connection web portal, there is currently no way to group hosts however it is a feature which is in development for a future release.

  • Purchase Order created from different client machine with same login ID

    Hi,
    Purchase Order created from different machine using same Login ID. How to trace IP address of that Machines.
    Thanks
    Hemanth

    Hi;
    Please review:
    Re: sql to get Machine IP
    Regard
    Helios

  • Create Hyper-V Virtual Machines with Windows PowerShell searching on hostname

    Dear,
    I’m a starter with PowerShell scripting an I’m looking for a script to create Hyper-V Virtual Machines with Windows PowerShell. The idea behind the script is that when I run the script its first searching for the hostname. I’m migrating 24 locations and each
    location have a different hostname like xxx-SRV001. The script needs to use the first 3 signs from the hostname in this case “xxx” and create 2 VM's with below info:
    Virtual Machine 1 2048MB
    Virtual Machine 2 4096MB
    Location D:\VM\
    I can create VM's with Powershell into Hyper-V so only a script to first searching for the first 3 characters of the hostname is enough.
    Example:
    It's the intention that when the script runs it's looking for the hostname. As example we have hostname 000-SRV001
    If the script see the first 3 characters of the hostname, in this case 000 he need to create 2 VMs with name xxx-SRV002 and xxx-SRV004
    I think it must be something with 
    $hostname = "Get-WmiObject -computername $Machine Win32_Computersystem"
    But then when i'm asking for $hostname he must give me back the hostname and if the hostname is 1 of the 24 locations then he need to create 2 vm's in Hyper-V with above info.
    Can you help me or do you have a script for this? 

    Juste use :
    $vram = 1GB*$vRam
    You not need the "
    Do you have any error with the creation of the VM?
    # Variables
    $VMName = Import-Csv "C:\HyperV\input.csv"
    $VHD = 40GB
    $VMLOC = "C:\HyperV"
    $vSwitch = "External"
    $ISO = "C:\ISO\WinServer2012R2.iso"
    $LocationCode = $env:COMPUTERNAME.Split("-")[0]
    # Create VM Folder
    MD $VMLOC -ErrorAction SilentlyContinue
    Foreach ($VM in $VMNames)
    $Name = $VM.name
    [int64]$vRam = $vm.vram
    $vram = 1GB*$vRam
    $VMName = $LocationCode+$Name
    # Create Virtual Machine
    New-VM -Name $VMName -Path $VMLOC -MemoryStartupBytes $vRam -NewVHDPath "$VMLOC\$VMName\Virtual Harddisks\$VMName.vhdx" -NewVHDSizeBytes $VHD -SwitchName $vSwitch
    # Configure Virtual Machines
    Set-VMDvdDrive -VMName $VMName -Path $ISO
    Start-VM $VMName
    # Configure Virtual Machines
    Set-VMDvdDrive -VMName $VMName -Path $ISO
    Start-VM $VMName
    Error message 
    New-VM : '003' failed to modify device 'Memory'. (Virtual machine ID 8F5F32D7-F1A0-4A68-8B01-CA6661869A1E)
    Invalid startup memory amount assigned for '003'. The minimum amount of memory you can assign to this virtual machine is '32' MB. (Virtual machine ID 8F5F32D7-F1A0-4A68-8B01-CA6661869A1E)
    A parameter that is not valid was passed to the operation.
    At line:20 char:5
    + New-VM -Name $VMName -Path $VMLOC -MemoryStartupBytes $vRam -NewVHDPath "$VM ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (Microsoft.HyperV.PowerShell.VMTask:VMTask) [New-VM], VirtualizationOperationFailedException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.NewVMCommand
    Set-VMDvdDrive : A parameter is invalid. Hyper-V was unable to find a virtual machine with name 003.
    At line:23 char:5
    + Set-VMDvdDrive -VMName $VMName -Path $ISO
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (003:String) [Set-VMDvdDrive], VirtualizationInvalidArgumentException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.SetVMDvdDriveCommand
    Start-VM : A parameter is invalid. Hyper-V was unable to find a virtual machine with name 003.
    At line:24 char:5
    + Start-VM $VMName
    + ~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (003:String) [Start-VM], VirtualizationInvalidArgumentException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.StartVMCommand
    Set-VMDvdDrive : A parameter is invalid. Hyper-V was unable to find a virtual machine with name 003.
    At line:27 char:5
    + Set-VMDvdDrive -VMName $VMName -Path $ISO
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (003:String) [Set-VMDvdDrive], VirtualizationInvalidArgumentException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.SetVMDvdDriveCommand
    Start-VM : A parameter is invalid. Hyper-V was unable to find a virtual machine with name 003.
    At line:28 char:5
    + Start-VM $VMName
    + ~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (003:String) [Start-VM], VirtualizationInvalidArgumentException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.StartVMCommand
    New-VM : '003' failed to modify device 'Memory'. (Virtual machine ID C0FC835E-36D4-462E-BD21-69A75A808E2F)
    Invalid startup memory amount assigned for '003'. The minimum amount of memory you can assign to this virtual machine is '32' MB. (Virtual machine ID C0FC835E-36D4-462E-BD21-69A75A808E2F)
    A parameter that is not valid was passed to the operation.
    At line:20 char:5
    + New-VM -Name $VMName -Path $VMLOC -MemoryStartupBytes $vRam -NewVHDPath "$VM ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (Microsoft.HyperV.PowerShell.VMTask:VMTask) [New-VM], VirtualizationOperationFailedException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.NewVMCommand
    Set-VMDvdDrive : A parameter is invalid. Hyper-V was unable to find a virtual machine with name 003.
    At line:23 char:5
    + Set-VMDvdDrive -VMName $VMName -Path $ISO
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (003:String) [Set-VMDvdDrive], VirtualizationInvalidArgumentException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.SetVMDvdDriveCommand
    Start-VM : A parameter is invalid. Hyper-V was unable to find a virtual machine with name 003.
    At line:24 char:5
    + Start-VM $VMName
    + ~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (003:String) [Start-VM], VirtualizationInvalidArgumentException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.StartVMCommand
    Set-VMDvdDrive : A parameter is invalid. Hyper-V was unable to find a virtual machine with name 003.
    At line:27 char:5
    + Set-VMDvdDrive -VMName $VMName -Path $ISO
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (003:String) [Set-VMDvdDrive], VirtualizationInvalidArgumentException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.SetVMDvdDriveCommand
    Start-VM : A parameter is invalid. Hyper-V was unable to find a virtual machine with name 003.
    At line:28 char:5
    + Start-VM $VMName
    + ~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidArgument: (003:String) [Start-VM], VirtualizationInvalidArgumentException
    + FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.StartVMCommand

  • Calling DB2 Stored procedure(with parameters) from powershell

    Hi 
    I am trying to call a DB2 stored procedure that has parameters from Powershell scrip and I am not able to can some one help me here?
    $ServerName = 'XXXX'
    $dbalias='XXXXX'
     $conn_string = "Provider=IBMDADB2;DBALIAS=$dbalias;Uid=;Pwd=;"
     $conn = new-Object system.data.Oledb.OleDbconnection
     $conn.ConnectionString = $conn_string
     $conn.open()
     $query="CALL DBID_CONTROL.GET_TABLE_MAINT_CTL(?,?,?,'MSAS','DATABASE_CONNECTIONS_CUBE','CUBE_PARTITION');"
     $cmd = new-Object system.data.Oledb.OleDbcommand($query,$conn)
      $ds=New-Object system.Data.DataSet
     $da=New-Object System.Data.OleDb.OleDbDataAdapter($cmd)
      $da.Fill($ds) [int]$cur_utc_date_key = $ds.Tables[0].Rows[0][0]
     $cur_utc_date          = $ds.Tables[0].Rows[0][1]
     ###list current date key & current date values
     write-output "current date key value is $cur_utc_date_key"
     write-output "current date value is $cur_utc_date"
     write-output " "
    Thanks

    Hi 
    This is the error message i get when i run the script
    Exception calling "Fill" with "1" argument(s): " CLI0100E  Wrong number of parameters. SQLSTATE=07001"
    At line:45 char:10
    +  $da.Fill <<<< ($ds)
        + CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : DotNetMethodException

  • Hyper-v Failover Cluster management via powershell

    Hi
        We are looking at having a management server act as proxy for managing couple of hyper-v clusters using CSV. We plan to do management using powershell commands.
        We create a session one of the host in the cluster  and execute commands using invoke-command. The cluster verbs seems to fail with the following warning. 
    WARNING: If you are running Windows PowerShell remotely, note that some failover clustering cmdlets do not
    work remotely. When possible, run the cmdlet locally and specify a remote computer as the target. To run the
     cmdlet remotely, try using the Credential Security Service Provider (CredSSP). All additional errors or
    warnings from this cmdlet might be caused by running it remotely.
      What is the recommended way to do setup for using FailoverCluster ? We want to have a single management server that act proxy for all servers clustered or not.
      Also, is there a document that describe various operations done via Failover Cluster Manager and corresponding powershell commands (or set of commands).
    Thanks
    /Jd

    Regarding the Stop action from Failover Cluster Manager, Eric, I understand your point. But when I do shutdown from Failover Cluster Manager, the VM shuts down as expected even when the setting is set to Save.
    I was very specifically talking about the Stop-ClusterGroup cmdlet, not any command issued in Failover Cluster Manager. But, well, yeah, if you tell a VM to shut down, it shuts down. I don't know why you'd expect anything different to happen. If you're looking
    for the equivalent to Stop-ClusterGroup inside Failover Cluster Manager, it's not called "Shut Down". You can use "Stop Role" on the "More Actions" menu for the VM. You can also find the configuration object (usually named in the format of "Virtual Machine
    Configuration XXX") and take it offline.
    I tested a number of times after your first post, and Stop-ClusterGroup does what the Cluster-Controlled Action is set to every single time for me.
    I could only make educated guesses at the underlying mechanics of FCM and PowerShell's cluster cmdlets, but the stand-out difference is that FCM has no method to operate in a double-hop situation at all, while PowerShell does. You only encounter these difficulties
    with PowerShell in that second hop. The question you're asking: "it would be great to know how Failover Cluster Manager works without this setup ?" is an apples-to-oranges comparison.
    This particular sentence of yours sort of changes the overall parameter of your question:
    "... so our automation works..."
    I was under the impression you were setting up this double-hop because you wanted admins to manually execute PowerShell cmdlets against your cluster from a single controlled location.
    If automation is your goal, do it right from the cluster. I obviously don't know your entire wishlist and it's none of my business, but this double-hop situation may not be ideal.
    Eric Siron Altaro Hyper-V Blog
    I am an independent blog contributor, not an Altaro employee. I am solely responsible for the content of my posts.
    "Every relationship you have is in worse shape than you think."

  • Cannot create mysites from powershell: Original XSLT List View Web Part not found

    I have a bizarre problem in my SharePoint 2013 farm. This does not occur in my test farm, only in the farm we were going to go live with.
    I'm on windows Server 2012, SQLServer 2012 SP1, SharePoint 2013 April CU. 1 appserver/centraladmin server, 2 web servers.
    When I log into our mysitehost and click newsfeed, it will create a mysite (even though first it displays "we are sorry there was a problem creating your site")
    But from powershell, whether I use $UserProfile.CreatePersonalSite() or New-SPSite, I get the following error:
    Original XSLT List View Web Part not found
    So far I've only found one other person with this:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/2503e42c-e114-4e89-8e00-89fe70f0b154/cannot-create-sharepoint-mysite-programmatically
    This is a brand new farm, created with the same scripts I created my test farm with, and same version of SharePoint. Only the service accounts are different. (Farm account has admin on the servers right now since I was setting up profile service).
    Some other errors from the same correlation ID that look related:
    It can't seem to find the listemplate 101
    And something looks wrong with the MySiteDocumentLibrary feature
    I have tried the following:
    1. run psconfig.exe on each server
    2. install-spfeature -AllExistingFeatures
    3. looped through the directory under Features and for each called Install-SPFeature $dirname -Force
    4. uninstalled and reinstalled MySiteDocumentLibrary feature
    5. blew away the whole farm (removed all servers from farm, deleted all databases) and recreated it.
    6. tried creating the UPA from the CentralAdmin gui.
    The only real difference I can think of between the working farm and non working farm is, I installed the working farm using RTM, then as they came out added the March PU and April CU. For this farm I installed RTM and March and April, and then ran my build
    farm script.
    I am at a loss. What do I need to do, re-install the binaries? That's all I can think of. What I love is that our test / POC system worked fine, and now 2 weeks before go-live I'm seeing errors on the production servers I've never seen before. Using the
    same scripts no less.
    Feature Activation: Feature 'Fields' (ID: 'ca7bd552-10b1-4563-85b9-5ed1d39c962a') was activated
    Feature Activation: Feature 'CTypes' (ID: '695b6570-a48b-4a8e-8ea5-26ea7fc1d162') was activated
    No document templates uploaded for list "$Resources:core,global_onet_solutiongallery_list;" -- none found for list template "100"
    Failed to find <ListTemplate> tag corresponding to ID "101", tried both onet.xml for site definition ID "0" language "1033" and global site definition. Operation failed.
    No document templates uploaded for list "$Resources:core,stylelibraryList;" -- none found for list template "121".
    System.Runtime.InteropServices.COMException: A user may not remove his or her own account from a site collection.<nativehr>0x81020051</nativehr><nativestack></nativestack>, StackTrace: at Microsoft.SharePoint.SPUserCollection.UpdateMembers
    Feature Activation: Feature 'MySitePersonalSite' (ID: 'f661430e-c155-438e-a7c6-c68648f1b119') was activated
    Feature Activation: Activating Feature 'MySiteDocumentLibrary'
    Calling 'FeatureActivated' method of SPFeatureReceiver for Feature 'MySiteDocumentLibrary'
    SharePoint Foundation Upgrade MySiteDocumentLibraryFeatureReceiveraj08n INFO Creating new My Documents library
    Unknown SPRequest error occurred. More information: 0x80070002
    SPRequest.GetMetadataForUrl: UserPrincipalName=, AppPrincipalName= ,bstrUrl=http://contoso/personal/cbuchholz/DOCUMENTS ,METADATAFLAGS=59
    System.IO.FileNotFoundException: <nativehr>0x80070002</nativehr><nativestack></nativestack>, StackTrace: at Microsoft.SharePoint.SPWeb.GetObjectForUrl at Microsoft.SharePoint.Portal.UserProfiles.MySiteDocumentLibraryUtil.GetSPObjectFromUrl ...
    <nativehr>0x80070002</nativehr><nativestack></nativestack>There is no Web named "/personal/cbuchholz/DOCUMENTS"
    Possible mismatch between the reported error with code = 0x81070504 and message: "There is no Web named "/personal/cbuchholz/DOCUMENTS"." and the returned error with code 0x80070002.
    Attemping to add webpart id 0F6072F2-E804-4CFD-837E-BB37332B9D1C to web http://contoso/personal/cbuchholz
    Adding XsltListViewWebPart calling SPRequest::CreateListViewPart. Web part id 0F6072F2-E804-4CFD-837E-BB37332B9D1C, web http://contoso/personal/cbuchholz
    Feature receiver assembly 'Microsoft.SharePoint.Portal, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c', class 'Microsoft.SharePoint.Portal.UserProfiles.MySiteDocumentLibraryFeatureReceiver', method 'FeatureActivated' for feature 'e9c0ff81-d821-4771-8b4c-246aa7e5e9eb' threw an exception: System.InvalidOperationException: Original XSLT List View Web Part not found at Microsoft.SharePoint.Portal.UserProfiles.MySiteDocumentLibraryUtil.ReplaceListViewWebPart
    Feature Activation: Threw an exception, attempting to roll back. Feature 'MySiteDocumentLibrary'
    Exception in EnsureFeaturesActivatedAtSite: System.InvalidOperationException: Original XSLT List View Web Part not found
    Failed to activate site-collection-scoped features for template 'SPSPERS#2' in site collection 'http://contoso/personal/cbuchholz'
    Failed to apply template "SPSPERS#2" to web at URL "http://contoso/personal/cbuchholz
    I've had other problems in this farm: the bug where when you add Administrators to a Search Service via the Manage Service Applications page, it removes the SPSearchDBAdmin role from the search service process account. That one did not happen in the other farm.
    At least other people have that one and I could just use the farm admin instead (still troublng of course).

    Ok,
    Here is the problem:
    When creating a mysite from powershell or script, apparently you can ONLY do this from a wfe (or a server running Microsoft SharePoint Foundation Web Application in services on server).
    You CANNOT create mysites from script on your appserver if it is not also a Web Application Server. I confirmed the same is true in my test farm. I guess I was always running most of these scripts on the webserver.
    I searched all over and cannot find this documented anywhere.
    Who do I contact to have Microsoft document this?
    It's Thursday morning, I've been working non stop since Saturday morning so you don't have to :)

  • Listing RDS 2012 R2 collections from powershell remote fails

    I'm trying to list different informations of a RDS server farm => from a remote client PC <=
    I do following but when typing the last command - I get an error.
    Knowing that that same command runs correctly when launched from an RDS server
    enter-pssession RDS-SERVER-XYZ.contoso.net
    import-module remotedesktop
    get-command -module remotedesktop
     Get-RDSessionCollection -ConnectionBroker RDS-BRK-1.contoso.net
     => fails with message :
     Cannot index into a null array.
     At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\remotedesktop\Utility.psm1:54 char:9
     +     if ($_script_resource[$Id])
     +         ~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : NullArray
     Cannot index into a null array.
     At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\remotedesktop\Utility.psm1:54 char:9
     +     if ($_script_resource[$Id])
     +         ~~~~~~~~~~~~~~~~~~~~~~
         + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
         + FullyQualifiedErrorId : NullArray
     Get-RDSessionCollection :
         + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
         + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-RDSessionCollection
    Listing RDS 2012 R2 collections from powershell remote fails / same commandlet from local RDS serevr works fine
    Am I missing something ?
    MCTS Windows Server Virtualization, Configuration

    Are the Windows Remote Management rules enabled on the inbound firewall of the RDSH server?
    If you are running multiple roles on the RDSH  server you may need to increase the size of the memory available for powershell remoting.
    Run Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1000 with powershell as an admin and reboot.
    HTH,
    JB

  • Remote Execution from Powershell Script called from Team Foundation Build

    Hello
       I am trying to deploy a sharepoint solution with a sharepoint script, with this approach:
    First i test the environment, using windows powershell console
    New-PSSession -ComputerName developmentserver01
    Enter-PSSession -computername developmentserver01
    d:
    cd d:\deploymentscripts
    .\deploysharepoint.ps1
     Then i start the automation:
       1.- TFS runs a build that call at the end to "deploy.ps1" locally in the build server. ---> this is working.
       2.- desploy1.ps1 copy the drop files to the development environment developmentserver01 shared folder.
       3.- after copy the files,  deploy1.ps1 connet with the development environment machine developmentserver01  using remote connection commands from powershell -->this is working.
       4.- this step fails, in this step i try to execute the deployment script deploySharepoint.ps1 that has copied in the development environment machine in the step 2.
         First using commands inside the script like in the powershell console, but i see that the commands are running inside the TFS build machine not in the machine that i connected whit remote connection
    d:
    cd d:\deploymentscripts
    .\deploysharepoint.ps1Later using different options (invoke-command, ...) only this optionk works:
    Invoke-Command -computername developmentserver01 -scriptblock{d:\DeploymentScripts\deploysharepoint.ps1 -solutionNames @("parameter1")}
    The problem it´s that i think that invoke-command don´t work like the commands using powershell console , because the script show the error that the user don´t haver permissions for accesing the Farm of sharepoint. If i run the script with remote session in a power shell console as show at the beginning of the post, all things work fine. How can i run the remote script deploysharepoint.ps1 with remote session from the script desploy.ps1, like using powershell console?

    have you tried passing credentials to it maybe use credssp, you could pass new session to your invoke-command although this shouldnt make difference, i basically think that when you opened this ps session it sees you admin therefore when you do the enter
    session you are still admin, when you use the invoke i am not so sure it keeps your creds..
    $s = New-PSSession -ComputerName developmentserver01
    Invoke-Command -session $s -scriptblock{d:\DeploymentScripts\deploysharepoint.ps1 -solutionNames @("parameter1")}

  • How to execute sql scripts from Powershell across multiple databases

    Re: How to execute sql scripts from Powershell across multiple databases
    I have an tsql script that I want to run across a list of databases. How is the best way to do this in Powershell? Thanks.

    My example below, using just the SMO and not breaking up the batches, the ExecuteWithResults give the following error when the .sql file contains a GO. My script files are as simple as a DECLARE and then a GO.
    WARNING: SQL Script Failed
    The object of type "Microsoft.PowerShell.Commands.Internal.Format.FormatStartData" is not valid or not in the correct sequence. This is likely caused by a user-specified "format-list" comm
    and which is conflicting with the default formatting.
        + CategoryInfo          : InvalidData: (:) [out-lineoutput], InvalidOperationException
        + FullyQualifiedErrorId : ConsoleLineOutputOutOfSequencePacket,Microsoft.PowerShell.Commands.OutLineOutputCommand
    Also, when executing from the ISE, is there a way to force the ISE to release the files. I am having to close the ISE and reopen my script every time I want to make a testing change to the .sql file.
    [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo")
    $scriptspath = "C:\temp\psExecuteSQLScripts\scripts"
    $SQLServer = "fidevc10"
    $SQLDB = "Bank03"
    # Create SMO Server Object
    $Server = New-Object ('Microsoft.SQLServer.Management.Smo.Server') $SQLServer
    # Get SMO DB Object
    $db = $Server.Databases[$SQLDB]
    # Load All SQL Scripts in Directory
    $scripts = Get-ChildItem -Path (Join-Path $scriptspath "*") -Include "*.sql" -Recurse
    # Loop through each script and execute
    foreach ($SQLScript in $scripts)
    $fullpath = $SQLScript.FullName
    # Read the Script File into Powershell Memory
    $reader = New-Object System.IO.StreamReader($fullpath)
    $script = $reader.ReadToEnd()
    # Execute SQL
    Write-Host "Executing $SQLScript on $SQLDB...."
    try
    $ds = $db.ExecuteWithResults($script)
    Foreach ($t in $ds.Tables)
    Foreach ($r in $t.Rows)
    Foreach ($c in $t.Columns)
    Write-Host $c.ColumnName "=" $r.Item($c)
    Write-Host "Complete"
    catch [Exception]
    Write-Warning "SQL Script Failed"
    echo $_.Exception|format-list -force
    Write-Host " " -BackgroundColor DarkCyan

  • Email access query from powershell

    I am trying to utilise the DoCmd.SendObject command, from powershell... I have the script launch the required database but I cannot get it to export the query information into Xl format and email it...
    This ran the macro that I had produced in Access but I was then required to manually click on an Outlook warning box so it has not resolved the issues.
    I just need to get this query data out of access either to save it locally and then send it via email or send it automatically...
    Does anyone have any experience of this?
    Your help will be most appreciated!
    Regards
    Richard

    Hi Richard,
    If you want to export the access query to excel format and send the excel report, have you tried the
    DoCmd.OutputTo
    Method, please also note I haven't tested
    $db = New-Object -ComObject Access.Application
    $db.OpenCurrentDatabase("foo.accdb")
    $db.DoCmd.OutputTo(1,"The_Report","YourQueryName", "Excel Workbook (*.xlsx)", , True)
    Refer to:
    Powershell Interaction with Access 2007, how to Save Report as PDF?
    DoCmd.OutputTo in xlsx (Excel 2007+) Format
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang

  • Remotely running SQL from PowerShell

    Hi
    I work for a Software House where checking files versions, running SQL to check tables is becoming run-of-the mill :)
    I'm very new to PowerShell so far and have just been playing about to find that I can remotely check file-versions ok. Now onto the other side of the coin....running SQL to check tables is the next thing I need to learn.
    Just for a heads-up. Most of the servers I connect to are running MS SQL Server 2003 (unfortanately) which is why I want to remotely check the servers without connecting in via Remote Desktop Session. With MS Server 2003, if I use a Remote Desktop
    Session, I've found that I would have to download PowerShell (v1) and then have to configure it to allow it to run my .ps1 scripts which would also become cumbersome.
    Can anyone give me a start and say how to remotely connect to and SQL database and then run a simple SELECT statement from PowerShell please. I can then build my powershell scripts up from there.
    Kind Regards
    Matt

    Hi
    I've tried this script but get the error below if anyone can help.
    # Get SQL rows if they exist
    $SqlConnection = New-Object System.Data.SqlClient.SqlConnection
    $SqlConnection.ConnectionString = "Server=\\10.1.2.3;Database=THEHOUSE;Integrated Security=True;User Id=Joe123;Password=password123"
    $SqlConnection.Open()
    $SqlCmd = New-Object System.Data.SqlClient.SqlCommand
    $SqlCmd.CommandText = "SELECT * FROM TABLEX WHERE TRANS_TYPE='ACG'"
    $SqlCmd.Connection = $SqlConnection
    $dbname = $SqlCmd.ExecuteScalar()
    $SqlConnection.Close()
    Write-output "Database is " $dbname
    The error I get is:
    Exception calling "Open" with "0" argument(s): "A network-related or instance-specific error occurred while
    establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the
    instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL
    Network Interfaces, error: 25 - Connection string is not valid)"
    At C:\PS1scripts\Get SQL table data.ps1:5 char:1
    + $SqlConnection.Open()
    + ~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : SqlException
    Exception calling "ExecuteScalar" with "0" argument(s): "ExecuteScalar requires an open and available
    Connection. The connection's current state is closed."
    At C:\PS1scripts\Get SQL table data.ps1:9 char:1
    + $dbname = $SqlCmd.ExecuteScalar()
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : InvalidOperationException

Maybe you are looking for

  • How Do I get icons image directory to work in a JAR file?

    Yes, I must admit after going through the tutorial and other stuff I am stiil stumped I have an application that uses the jlfgr icons for the toolbar, and it works fine as long as i actually run it from the directory that it is in. I would like to pu

  • InDesign CS5: How do I delete or remove an unwanted document preset?

    I've been porting over my workflow from CS4 to CS5, and yesterday I was adding a custom document preset. When saving it, my fingers tripped while typing its name and accidentally hit the Return key (instead of Delete, after making another mistake!),

  • Excise report ER1 and Service Tax report SC-3

    Dear Gurus, I want to know the following things from the transaction code J2IER1 and J2IC In transaction code J2IER1, their is one radio button, Details of other payments made. What does it stands for? In transaction code J2IC, what are the prerequis

  • IDoc Basic Type List

    Hi Expert, Beside using t-code WE60, is there any link (sap help) that can show the list of IDoc Type list and the segment detail and sap field related. As an example: http://help.sap.com/saphelp_di46c2/helpdata/EN/44/f50abfea3b11d194dc0000e83dd751/c

  • Adobe form distribution problem

    Form created in LiveCycle and distributed with Adobe Pro...3 choices for distribution. 1) Through Acrobat.com (which stores the responses on Adobe servers) 2)  By email (This is not an option for me because these forms can not  invoke an email client