Adding a subterm into a term via powershell

Hi,
Not sure if this would be the best place of this post, but here goes.
I have a script that will add a termstore item if it doesn't exist in the termstore. But I'm wondering how would I create a subterm within one that actually exists?
For example I want to be able to create a "subterm 2" in TestTerm2.
#Connect to Central Admin
$taxonomySite = get-SPSite http://site.com
#Connect to Term Store in the Managed Metadata Service Application
$taxonomySession = Get-SPTaxonomySession -site $taxonomySite
$termStore = $taxonomySession.TermStores["STORE"]
#Connect to the Group and Term Set
$termStoreGroup = $termStore.Groups["GROUP"]
#TermSet Create
#$termStoreGroup.CreateTermSet("sets")
$termSet = $termStoreGroup.TermSets["SETS"]
function Add-TermStoreItem
DO{
$resp = Read-Host "Enter Name"
$Name = $resp
$lookup = $termset.terms | where-object {$_.name -eq $resp}
If ($lookup -eq $Null) {$term = $termSet.CreateTerm($resp, 1033)
Write-Host "The term" $resp "was added to the termstore" -foreground green
$termStore.CommitAll()}
Else {Write-host $resp "Already exists in the termstore please try again" -foreground red}
}While ($lookup -ne $Null)
$taxonomySite.Dispose()
Add-TermStoreItem
Any help would be amazing!
If this is helpful please mark it so. Also if this solved your problem mark as answer.

Hey, best way is to create a .csv file and import it to Term Store using powershell. 
Here is an complete solution PowerShell script to import Term-sets from .csv file to Term-Store 
In order to create a Term, under a term - you will need to modify the .csv file and add multiple level
This csv you can modify using excel and add Level 1, 2 till 7 and use the powershell to import from csv.
get2pallav
Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

Similar Messages

  • Adding eDirectory Trustee Rights to users via Powershell

    Hello,
    I have to make several hundred subdirectories corresponding to certain users on an eDirectory volume and then add RW trustee rights for only the one corresponding user for each subdirectory. I have a powershell script which adds the subdirectories but assigning
    the rights is proving problematic. I though I had found a solution with command line program lrights.exe but cant get that to work. Does anyone have any ideas on how to solve this trouble. Here is the relevant part I have so far:
    #Create the array from the csv file selecting the columns you want in your array.
    $Sen_Opt_Array = Import-Csv $Senior_Options_CSV | Select First, Last
    #Check If Directory Empty.
    If (Test-Path -Path $Senior_Directory -PathType Container) {
    $directoryInfo = Get-ChildItem $Senior_Directory | Measure-Object
    #$directoryInfo.count returns the count of all of the files in the directory
    #Note.The 1 & 48 replace having to write out the [System.Windows.Forms.MessageBoxButtons]::OKCancel,[System.Windows.Forms.MessageBoxIcon]::Warning)
    #Portions of the [Windows.Forms.MessageBox] command
    If (!($directoryInfo.count -eq 0)) {
    $Dir_Check = [Windows.Forms.MessageBox]::Show("Warning.The Directory is Not Empty! Do You Want To Continue?","Attention",1,48)
    If (!($Dir_Check -eq "OK")) {
    Break
    for($i = 0; $i -le $Sen_Opt_Array.count -1; $i++) {
    $S_Name = $Sen_Opt_Array[$i]
    <#I need to force the evaluation of each value so I can display the data. To do this, I use a subexpression.
    A subexpression consists of a dollar sign and a pair of parentheses.#>
    New-Item -Path $Senior_Directory\$($S_Name.Last)$($S_Name.First.Substring(0,1)) -ItemType Directory -Force
    [Windows.Forms.MessageBox]::Show("$($Sen_Opt_Array.count) Files Created in $Senior_Directory Directory.","Attention", [Windows.Forms.MessageBoxButtons]::OK, [Windows.Forms.MessageBoxIcon]::Information)
    Break
    Thanks.

    This will get you closer to what you want.,  You cannot use "break" to stop a stream of code.  It only works in a loop.
    function CreateFolders {
    Param (
    [IO.FileInfo]$dirInfo = $Senior_Directory,
    [array]$Sen_Opt_Array
    if ($dirInfo.Exists) {
    if ('Ok' -eq [Windows.Forms.MessageBox]::Show('Warning.The Directory is Not Empty! Do You Want To Continue?', 'Attention', 1, 48)) {
    } else {
    # create folder ?
    # if not then exit
    return
    for ($i = 0; $i -le $Sen_Opt_Array.count - 1; $i++) {
    $folderName = '{0}\{1}' -f $Senior_Directory, $S_Name.Last, $S_Name.First.Substring(0, 1)
    Write-Host "Creating folder $folderName" -ForegroundColor green
    Try {
    $itm=New-Item -Path $folderName -ItemType Directory -Force -ea 'Stop'
    $acl= Get-Acl $itm
    # assign user as trustee
    $acl.SetOwner($trustee)
    Set-Acl $itm $acl
    } Catch {
    Write-Host "$_" -ForegroundColor red
    ¯\_(ツ)_/¯

  • HT1844 Library Issue:  I just imported 2 CD's into ITunes.  They show up in "Recently Added" and on my other devices via ITunes Match, but NOT in the ITunes software on the computer where I added them.

    Library Issue:  I just imported 2 CD's into ITunes.  They show up in "Recently Added" and on my other devices via ITunes Match, but NOT in the ITunes software on the computer where I added them.  They show up in the search box, but when I click on the results it just kicks me to ALL my music.  I have imported thousands of songs/CD's before and this is a new one.

    Something may have gone wrong with the index of the Music playlist. Making another change to the library such as downloading the current iTunes Free Single of the Week, or deleting one track from your library and reimporting it, should fix the problem.
    If that doesn't work close iTunes and delete the hidden file sentinel from inside the main iTunes folder, then start iTunes again. It should run a consistency check when it starts up which ought to correct things.
    tt2

  • Adding a shared mailbox to a user's Outlook profile, who has reviewer rights only, via PowerShell

    Hello Everyone,
    I'm working on trying to create something like a knowledge base for my company, and what I'm trying to accomplish is to create a shared mailbox on 365, add users to have read-only rights to the Inbox (which I can achieve via PowerShell) so they can't delete
    the articles, but it seems that by just adding Reviewer permission to a user, it doesn't force the mailbox to open on the end-user's Outlook profile - it only seems to automatically populate if I go through the exchange admin console and allow Full Access
    through User Delegation. 
    Is there a way, via PowerShell, to open a shared mailbox in a user's Outlook profile?
    Thanks for all the help!

    Hi,
    We can create a PRF file that modifies the existing Outlook profile to add the shared mailbox.
    Please have a look at this thread which discussed a similar issue:
    http://social.technet.microsoft.com/Forums/systemcenter/en-US/374e5a31-1732-45b8-afdd-7c0987e04a7e/how-to-add-additional-mailboxes-in-outlook-for-exchange
    For more information about Customize Outlook profiles by using an Outlook Profile (PRF) file, see:
    http://technet.microsoft.com/en-us/library/cc179062(v=office.14).aspx
    Hope this helps.
    Regards,
    Steve Fan
    TechNet Community Support

  • How to Add Multiple Driver Packages Using Reference File via PowerShell

    Hey All - 
    I've got a task I'm working on which would be much easier via PowerShell.  I tried figuring it out, but couldn't so thought I'd post.
    The Task
    I need to create about 50 new, empty driver packages (most are in the same folder in the console) and am trying to find a method of doing so where I may use a source text file / csv file as reference in the command line.  Each package has a unique name
    and source path.  Here are examples:
    - Latitude E5440 Win7 x86 [A01]   \\server\drivers\5440x86
    - Latitude E5440 Win7 x64 [A01]   \\server\drivers\5440x64
    The Structure
    All of the ones I want to add via PowerShell will go into the same folder in the console.  They will be in the folder "root\New Drivers\Dell CAB Drivers" 
    Any ideas or will this just take more time than it's worth for 50?  Thanks!
    Ben K.

    Also, the creation of the driver package won't be your biggest challenge, as it's as simple as New-CMDriverPackage (see:
    http://technet.microsoft.com/en-us/library/jj821724(v=sc.20).aspx).
    The biggest challenge is relating your models to a share name (unless they're all Latitude).
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • [Forum FAQ] How to install and configure Windows Server Essentials Experience role on Windows Server 2012 R2 Standard via PowerShell locally and remotely

    As we all know,
    the Windows Server Essentials Experience role is available in Windows Server 2012 R2 Standard and Windows Server 2012 R2 Datacenter. We can add the Windows Server
    Essentials Experience role in Server Manager or via Windows PowerShell.
    In this article, we introduce the steps to install and configure Windows
    Server Essentials Experience role on Windows Server 2012 R2 Standard via PowerShell locally and remotely. For better analyze, we divide this article into two parts.
    Before installing the Windows Server Essentials Experience Role, please use
    Get-WindowsFeature
    PowerShell cmdlet to ensure the Windows Server Essentials Experience (ServerEssentialsRole) is available. (Figure 1)
    Figure 1.
    Part 1: Install Windows Server Essentials Experience role locally
    Add Windows Server Essentials Experience role
    Run Windows PowerShell as administrator, then type
    Add-WindowsFeature ServerEssentialsRole cmdlet to install Windows Server Essentials Experience role. (Figure 2)
    Figure 2.
    Note: It is necessary to configure Windows Server Essentials Experience (Post-deployment Configuration). Otherwise, you will encounter following issue when opening Dashboard.
    (Figure 3)
    Figure 3.
      2. Configure Windows Server Essentials Experience role
    (1)  In an existing domain environment
    Firstly, please join the Windows Server 2012 R2 Standard computer to the existing domain through the path:
    Control Panel\System\Change Settings\”Change…”\Member of. (Figure 4)
    Figure 4.
    After that, please install Windows Server Essentials Experience role as original description. After installation completed, please use the following command to configure Windows
    Server Essentials:
    Start-WssConfigurationService –Credential <Your Credential>
    Note: The type of
    Your Credential should be as: Domain-Name\Domain-User-Account.
    You must be a member of the Enterprise Admin group and Domain Admin group in Active Directory when using the command above to configure Windows Server Essentials. (Figure 5)
    Figure 5.
    Next, you can type the password for the domain account. (Figure 6)
    Figure 6.
    After setting the credential, please type “Y” to continue to configure Windows Server Essentials. (Figure 7)
    Figure 7.
    By the way, you can use
    Get-WssConfigurationStatus
    PowerShell cmdlet to
    get the status of the configuration of Windows Server Essentials. Specify the
    ShowProgress parameter to view a progress indicator. (Figure 8)
    Figure 8.
    (2) In a non-domain environment
    Open PowerShell (Run as Administrator) on the Windows Server 2012 R2 Standard and type following PowerShell cmdlets: (Figure 9)
    Start-WssConfigurationService -CompanyName "xxx" -DNSName "xxx" -NetBiosName "xxx" -ComputerName "xxx” –NewAdminCredential $cred
    Figure 9.
    After you type the commands above and click Enter, you can create a new administrator credential. (Figure 10)
    After creating the new administrator credential, please type “Y” to continue to configure Windows Server Essentials. (Figure 11)
    After a reboot, all the configurations will be completed and you can open the Windows Server Essentials Dashboard without any errors. (Figure 12)
    Figure 12.
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Part 2: Install and configure Windows Server Essentials Experience role remotely
    In an existing domain environment
    In an existing domain environment, please use following command to provide credential and then add Server Essentials Role: (Figure 13)
    Add-WindowsFeature -Name ServerEssentialsRole
    -ComputerName xxx -Credential DomainName\DomainAccount
    Figure 13.
    After you enter the credential, it will start install Windows Server Essentials role on your computer. (Figure 14)
    Figure 14.
    After the installation completes, it will return the result as below:
    Figure 15.
    Next, please use the
    Enter-PSSession
    cmdlet and provide the correct credential to start an interactive session with a remote computer. You can use the commands below:
    Enter-PSSession –ComputerName
    xxx –Credential DomainName\DomainAccount (Figure 16)
    Figure 16.
    Then, please configure Server Essentials Role via
    Add-WssConfigurationService cmdlet and it also needs to provide correct credential. (Figure 17)
    Figure 17.
    After your credential is accepted, it will update and prepare your server. (Figure 18)
    Figure 18.
    After that, please type “Y” to continue to configure Windows Server Essentials. (Figure 19)
    Figure 19.
    2. In a non-domain environment
    In my test environment, I set up two computers running Windows Server 2012 R2 Standard and use Server1 as a target computer. The IP addresses for the two computers are as
    below:
    Sevrer1: 192.168.1.54
    Server2: 192.168.1.53
    Run
    Enable-PSRemoting –Force on Server1. (Figure 20)
    Figure 20.
    Since there is no existing domain, it is necessary to add the target computer (Server1) to a TrustedHosts list (maintained by WinRM) on Server 2. We can use following command
    to
    add the TrustedHosts entry:
    Set-Item WSMan:\localhost\Client\TrustedHosts IP-Address
    (Figure 21)
    Figure 21.
    Next, we can use
    Enter-PSSession
    cmdlet and provide the correct credential to start an interactive session with the remote computer. (Figure 22)
    Figure 22.
    After that, you can install Windows Server Essentials Experience Role remotely via Add-WindowsFeature ServerEssentialsRole cmdlet. (Figure 23)
    Figure 23.
    From figure 24, we can see that the installation is completed.
    Figure 24.
    Then you can use
    Start-WssConfigurationService cmdlet to configure Essentials Role and follow the steps in the first part (configure Windows Server Essentials Experience in a non-domain environment) as the steps would be the same.
    The figure below shows the status of Windows Server Essentials.
    Figure
    25.
    Finally, we have successfully configured Windows Server Essentials on Server1. (Figure 26)
    Figure 26.
    More information:
    [Forum
    FAQ] Introduce Windows Powershell Remoting
    Windows Server Essentials Setup Cmdlets
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

  • Promlem with loading QT content in Safari into a div via innerHTML

    Hello,
    I have created a website where I'm loading QT content into a div via Javascript by using InnerHTML. I'm generating the Object/embed with javascript. Take a look at the following javascript function:
    //This function generates object/embed tags on the page
    //each time a movie thumbnail is clicked
    function showMovie(folder, previewUrl, movieUrl)
    var content = new getObj('content');
    var movieObj = new getObj('contentMovie');
    if(BrowserDetect.browser == 'Safari')
    //I added this bit becaus Safari kept on playing the previous movie
    movieObj.obj.Stop();
    content.obj.innerHTML = '';
    var urlStart = "[(base_url)]" + folder + "/";
    var qtUrl = movieUrl.split('../')[1];
    qtUrl = urlStart + qtUrl;
    var myQTObject = new QTObject(previewUrl.split('.')[0] + ".gif", "contentMovie", "489", "280");
    myQTObject.altTxt = "Upgrade your Quicktime Player!";
    myQTObject.addParam("name", "contentMovie");
    myQTObject.addParam("href", movieUrl);
    myQTObject.addParam("controller", "true");
    myQTObject.addParam("scale", "tofit");
    myQTObject.addParam("target", "myself");
    myQTObject.addParam("autoplay", "true");
    myQTObject.addParam("saveembedtags", "true");
    myQTObject.addParam("enablejavasript", "true");
    content.obj.innerHTML = myQTObject.getHTML();
    As you can see I'm specifically checking to see if the browser is Safari, then I'm stopping the movie via javascript. It seems that Safari keeps all the movies in memory and somhow loads them on top of each other instead of disposing of them when the innerHTML is set to an empty string... this took care of one problem which was preventing Safari from playing multiple movies at once(somehow stacking on top of each other). However, the fastStart movies keep loading in the background so you could argue that Safari is leaking memory and loading movies in the background that should not be there.
    Does anyone have a clue on how to fix this? Wouldn't you define this as a bug? I took a look at the QT javascript API and it seems to me that there is no command that tells the movie to stop loading or howto dispose of it. Maybe I can swap the movie URL via javascript if the browser is Safari, but I'd like to know if there is another way since I'm using a poster movie and I imagine it will complicate things. Anyway, you can test for your self on www.koggull.com/index.php, if you don't understand the problem. I suggest that you keep Activity Monitor open, then you can see how Safari eats up memory when browsing my website. All help would be greatly appreciated.
    MacBookPro Core2 duo 2.33 Ghz   Mac OS X (10.4.8)  

    FYI I posted a similar question in one of the Quicktime forums. I haven't gotten any answers: http://discussions.apple.com/thread.jspa?threadID=764296&tstart=0

  • Add Multiple Domains as an External Relay via powershell from a list

    Hello, 
    I have a requirement to add a few hundred external domains as a relay and would like to accomplish this via powershell. I'm familiar with the command to submit 1 at a time but would like to have it read them all in from a list if possible. Any help would
    be great! 
    Thank you, 
    Eric 

    Hello Eric,
    Just replied similar question in a thread, you can refer to that...
    http://social.technet.microsoft.com/Forums/exchange/en-US/b84cd2e7-5fb3-4a1d-9bcc-41acdb7142a2/adding-multiple-accepted-domains-with-importcsv?forum=exchangesvrdeploy

  • SQL job running DTEXEC.EXE via PowerShell step produces wrong characters in result tables. Running the same DTEXEC.EXE in PowerShell x86 window produces correct results.

    I've created a package in SSDT (Visual Studio 2012) to import DBF tables into MSSQL 2014 via a wizard.
    Source DBF files contain tables with Russian (Cyrillic) characters in records fields.
    Created package works fine, produces correct results (imports Cyrillic characters as needed) while:
    •debugging in VS2012
    •deploying package in SSISDB and running the package via PowerShell x86:
    &"c:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\DTExec.exe" /Server "server\mssql2014" /ISServer "\SSISDB\import\Integration Services Project16\Package1.dtsx";
    But when I create a SQL Agent job with a single PowerShell step that contains the same command and run the job it produces wrong characters in resulting tables. So, the problem is in wrong code page (or encoding). The correct tables with records are
    produced and job runs without errors.
    I tried
    chcp 1251; # 855, 866 -- all of them
    &"c:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\DTExec.exe" /Server "server\mssql2014" /ISServer "\SSISDB\import\Integration Services Project16\Package1.dtsx";
    in SQL Agent PowerShell step, but with no positive result.
    Anyone encountered such a behavior? How to fix it?
    v

    What if you run this package without PowerShell?
    Arthur My Blog

  • Assign applications to MakeModel via Powershell

    I am attempting to script adding Multiple make an models via PowerShell.  I need to know if I can add a LTI application to the makemodel ID via PowerShell assuming I have the application's GUID.

    Looks like that does no work either:
    PS C:\Users\Administrator\Documents> New-MDTMakeModel -make 'VMware, Inc. 001' -model 'VMware Virtual Platform' -settings @{Application001="5da3d622-c936-4ccc-836e-f5833da0d416"}
    Exception calling "ExecuteScalar" with "0" argument(s): "Invalid column name 'A
    pplication001'."
    At C:\Users\Administrator\Downloads\mdtdb\MDTDB.psm1:1177 char:43
    +         $null = $settingsCmd.ExecuteScalar <<<< ()
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException
    Added settings for the specified make model
    The Make and Model get added but the applications are not assigned.  I had copied the guid directly from the workbench.  What is interesting is that when something successfully is imported the list of all available options appear, however Application
    is not one of them.

  • DELETE Windows Agents (agent monitored computers) via Powershell - HOW??

    It's really ridiculous that I have to ask this question, but as the shaft
    has clearly not given the countless scom customers of the world this information in an easy straightforward manner, I will ask the question.
    As bazillions of you have discovered through days of endless googling, there is NO easy way to simply delete windows agents (AGENT MANAGED COMPUTERS) from the scom console via powershell by using something as crazy and far out there as a ............cmdlet
    I could RING the necks of the shaft personnel who have not supplied the countless scom customers with this simple AND VERY NEEDED functionality - this is ground zero functionality, NOWHERE TO BE FOUND.  I did find old 2007 scripts, and scripts that
    just don't work, or poorly documented methods, etc.   
    So I wanted to ask if anyone out there has a straightforward, WORKING solution to do the following:
    completely DELETE windows agents (AGENT MANAGED COMPUTERS) from the scom console using
    powershell AND  a provided text list file of servers   (I.E.  C:\TEMP\serverlist.txt  )
    On behalf of the entire world, thanks in advance.

    There is no need to install anything, these commands will work on any server that has SCOM installed.
    This is a powershell script.
    If you need to use this to read from a text file  with one server per line (let's say C:\temp\agentlist.txt ), what you could do is copy this into a .ps1 file :
    function global:Delete-SCOMAgent([System.String[]] $agentNames)
    $administration = (get-scommanagementgroup).getadministration()
    $agentManagedComputerType = [Microsoft.EnterpriseManagement.Administration.AgentManagedComputer]
    $genericListType = [System.Collections.Generic.List``1]
    $genericList = $genericListType.MakeGenericType($agentManagedComputerType)
    $agentlist = new-object $genericList.FullName
    foreach ($agentName in $agentNames)
    $agent = Get-SCOMAgent -dnshostname $agentname*
    $agentlist.add($agent)
    $genericReadOnlyCollectionType = [System.Collections.ObjectModel.ReadOnlyCollection``1]
    $genericReadOnlyCollection = $genericReadOnlyCollectionType.MakeGenericType($agentManagedComputerType)
    $agentReadOnlyCollection = new-object $genericReadOnlyCollection.FullName @(,$agentList)
    $administration.DeleteAgentManagedComputers($agentReadOnlyCollection)
    $agentlist = Get-Content C:\temp\agentlist.txt foreach ($agent in $agentlist) {
    Delete-SCOMAgent $agent }
    and then run this from a powershell prompt with the command ./nameofthescript.ps1

  • Creating enhanced detection method via powershell

    Hi folks,
    im trying to automate the application creation process and so far I got a lot of usefull hints and tipps from technet forum etc.pp.
    I would like to set an registry detection method via powershell.
    Since I am not used to C# I found a nice approach translating a C# script into PS script.
    http://social.technet.microsoft.com/Forums/de-DE/93bddee4-6aee-4641-b104-170968ad1549/automating-application-creation?prof=required
    Unfortunately I can't get it to work... (same error as descriped in the link above "generic Error from the Put()-Function.") When I am using e.g. an MSI productcode as detection method in my script, I am able to create an application with
    deploymenttype and detectionmethod.
    Has anyone a solution for this problem ? Or was anyone able to set a registry detection via powershell ? Is it possible ?
    Any help will be appreciated.

    Any time I've seen a Put() error, the problem has been I've been missing a needed property.
    If you are using Config Manager 2012 R2 (Not sure about previous versions), you can use the built in cmdlet Add-CMDeploymentType.  This is the command I use.  For a PS detection type, change ScriptType to Powershell and $Script will be your detection
    script.
    $param = @{ApplicationName=$Name
                    DeploymentTypeName=$ScriptName
                    InstallationProgram=$Install
                    ScriptType="VBScript"
                    ScriptContent=$Script
                    InstallationBehaviorType="InstallForSystem"
                    ContentLocation=$SourceLocation
                    UninstallProgram = $Uninstall
                    LogonRequirementType="WhetherOrNotUserLoggedOn"
                    InstallationProgramVisibility="Hidden"
            Add-CMDeploymentType @param -ScriptInstaller -ManualSpecifyDeploymentType -DetectDeploymentTypeByCustomScript

  • Calculate factorial via powershell scripting

    hello guys i written script until calculate the factorial via powershell but i do not know what does not work !
    function factorial( [int] $n ) 
        $result = 1; 
        if ( $n -gt 1 ) 
            $result = $n * ( factorial ( $n - 1 ) ) 
        $result 
    this function can not work with big number like that 999 how can i solve that problem?

    I get similar results, with a slightly different function. I get results up to at least 170. From 180 through at least 990 I get "Infinity" for the answer. At 999 I get your error, which I believe cannot be avoided. Even if you avoided the
    call depth error, PowerShell seems to refuse to deal with such large numbers, and simply outputs "Infinity".
    This article goes into factorials in depth:http://en.wikipedia.org/wiki/Factorial
    It includes a table for very large values, plus a formula for approximating factorials of large numbers. You might be able to code the approximation formula.
    Richard Mueller - MVP Directory Services

  • Failed timer jobs via powershell

    Hi Friends,
    Is it possible to get an output of the failed timer jobs in the Central Admin via powershell? If yes, could anybody please share the script?
    Shonilchi..

    Hi Shonilchi, 
    You haven't actually changed the script, other than to pipe the output of Format-Table to a text file. 
    The script (that I posted above) creates a collection of "jobs", which are stored in the $jobCollection variable. 
    The original code I posted above contained an example that filtered the collection based on a webapplication URL (which was http://devmy101), and then displayed the results using Format-Table.
    To create a CSV report using this collection, you would send the $jobCollection variable to the Export-CSV PowerShell cmdlet, like this:
    $jobCollection | Export-Csv -Path C:\temp\jobsreport.csv -NoTypeInformation
    If you wanted to create a CSV report of all the jobs that had failed on the farm, then this would be the complete code:
    $items = New-Object psobject
    $items | Add-Member -MemberType NoteProperty -Name "Title" -value "" ;
    $items | Add-Member -MemberType NoteProperty -Name "Schedule" -value "" ;
    $items | Add-Member -MemberType NoteProperty -Name "WebApplication" -value "" ;
    $webapplications = Get-SPWebApplication
    $jobCollection = @();
    foreach($wa in $webapplications)
    $jd = $wa.JobDefinitions;
    foreach($job in $jd)
    $j = $items | Select-Object *;
    $j.Title=$job.Title;
    $j.WebApplication=$job.WebApplication.Url;
    $j.Schedule=$job.Schedule;
    $jobCollection += $j
    #Add the farm jobs
    $f = get-spfarm
    $ts = $f.TimerService
    $jd = $ts.JobDefinitions
    foreach($job in $jd)
    $j = $items | Select-Object *;
    $j.Title=$job.Title;
    $j.WebApplication="Farm";
    $j.Schedule=$job.Schedule;
    $jobCollection += $j
    #Create the report and save it as jobsreport.csv in the C:\temp directory
    $jobCollection | Export-Csv -Path C:\temp\jobsreport.csv -NoTypeInformation
    Regards, Matthew
    MCPD | MCITP
    My Blog
    Please remember to click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.
    I just added a webpart to the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here:
    Upload and Crop User Profile Photos

  • I am trying to connect a Windows 7 / 64 bit to an Epson printer on my Mac.  The printer is hooked into the Mac via USB; the Mac is networked to a Linksys wireless router with an ethernet cable, as is the Windows box. Any tips on how to do this?

    I am trying to connect a Windows 7 / 64 bit to an Epson printer on my Mac.  The printer is hooked into the Mac via USB; the Mac is networked to a Linksys wireless router with an ethernet cable, as is the Windows box. I installed the current Bonjour printer services software on the Windows machine, and separately installed the driver software for the Epson printer on the WIndows machine.  Running the bonjour wizard, I get an alert saying 'I don't have sufficient access to my computer to connect to the selected printer'.
    The printer has 'sharing' turned on from the Mac end; this works with a Powerbook via the wireless connection.  Sharing is also turned on in the Windows printer control panel for this printer (under properties).  The Mac is a G5 running 10.5.8.  When I try to print a page from the Windows machine it gets hung in the print queue.
    Any advice how to proceed would be appreciated!
    thx,

    I am trying to connect a Windows 7 / 64 bit to an Epson printer on my Mac.  The printer is hooked into the Mac via USB; the Mac is networked to a Linksys wireless router with an ethernet cable, as is the Windows box. I installed the current Bonjour printer services software on the Windows machine, and separately installed the driver software for the Epson printer on the WIndows machine.  Running the bonjour wizard, I get an alert saying 'I don't have sufficient access to my computer to connect to the selected printer'.
    The printer has 'sharing' turned on from the Mac end; this works with a Powerbook via the wireless connection.  Sharing is also turned on in the Windows printer control panel for this printer (under properties).  The Mac is a G5 running 10.5.8.  When I try to print a page from the Windows machine it gets hung in the print queue.
    Any advice how to proceed would be appreciated!
    thx,

Maybe you are looking for