ImAhNoBoDy

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • in reply to: Script for finding a list of distinguished AD names? #256913
    Participant
    Topics: 13
    Replies: 15
    Points: 85
    Rank: Member
    • This reply was modified 1 month ago by ImAhNoBoDy.
    Participant
    Topics: 13
    Replies: 15
    Points: 85
    Rank: Member

    Set-PrintConfiguration -PrinterName "Name of Printer" -DuplexingMode OneSided 

    Participant
    Topics: 13
    Replies: 15
    Points: 85
    Rank: Member
    • This reply was modified 1 month, 1 week ago by ImAhNoBoDy.
    • This reply was modified 1 month ago by ImAhNoBoDy.
    • This reply was modified 1 month ago by ImAhNoBoDy.
    • This reply was modified 1 month ago by grokkit.
    in reply to: XML ChildNode retrieve value #229840
    Participant
    Topics: 13
    Replies: 15
    Points: 85
    Rank: Member

    Surprising I actually found the answer.

    I actually found the answer by doing this:

    in reply to: Insert value from pipeline to declare .NET class #194843
    Participant
    Topics: 13
    Replies: 15
    Points: 85
    Rank: Member

    I was able to figure this out:

     

    in reply to: Insert value from pipeline to declare .NET class #194807
    Participant
    Topics: 13
    Replies: 15
    Points: 85
    Rank: Member

    It’s to let me know what values are in each property. It’s so I don’t need to look at the Microsoft doc and I have it ready at a moment’s notice.

    in reply to: Create hashtable variable within a hashtable #143847
    Participant
    Topics: 13
    Replies: 15
    Points: 85
    Rank: Member

    I was able to figure it out:

    in reply to: Create hashtable variable within a hashtable #143778
    Participant
    Topics: 13
    Replies: 15
    Points: 85
    Rank: Member

    If I’ve got you right you’re looking for something like this:

    PowerShell
    14 lines

    <textarea class=”ace_text-input” style=”opacity: 0; height: 18px; width: 6.59781px; left: 83.9891px; top: 108px;” spellcheck=”false” wrap=”off”></textarea>

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    $prog = @(
    @{
    WD = ‘C:\windows\system32’;
    TargetPathPath = ‘C:\cms\Support’;
    File = ‘cmd.exe’;
    App = ‘/c `$`_.TargetPathPath + Desktopinfo.exe’
    }
    )
    $prog |
    ForEach-Object {
    $pop = $_.TargetPathPath
    Start-Process WorkingDirectory $_.WD FilePath $_.File ArgumentList $_.App
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    You create a variabel $pop without using it. You might read about_Splatting.

    To format your code as code here in this forum you should use the code tag buttons “pre” right above the edit window when you create a post. Thanks …. it’s even easier to see what’s wrong when you format your code nicely.

    Yea, I was messing around with different variables and rearranging values when I created the pop variable. i just forgot to remove it when I posted.  I was in a rush to get home when I posted earlier and didn’t review all of the code.

    I still can’t get that app to open with the code you posted. I know the reason why it’s not working, but don’t know how to get TargetPath to be resolved correctly when put in as a value like that.

    in reply to: In/Notin operator outputs to collection #112762
    Participant
    Topics: 13
    Replies: 15
    Points: 85
    Rank: Member

    So the code should be this?:

    Hm…this is the result that I got:

    Name                                                                                        Application Name
    {Dragon1,Dragon2,Dragon3,Pet1,Pet2…}                         Application 1
    {Dragon1,Dragon2,Dragon3,Pet1,Pet2…}                         Application 2
    {Dragon1,Dragon2,Dragon3,Pet1,Pet2…}                         Application 3
    {Dragon1,Dragon2,Dragon3,Pet1,Pet2…}                         Application 4
    {Dragon1,Dragon2,Dragon3,Pet1,Pet2…}                         Application 5
    {Dragon1,Dragon2,Dragon3,Pet1,Pet2…}                         Application 6
    {Dragon1,Dragon2,Dragon3,Pet1,Pet2…}                         Application 7

    Edit, might have to do it this way, but wish it was a little cleaner:

    in reply to: Changing text color in RichText within a function #94498
    Participant
    Topics: 13
    Replies: 15
    Points: 85
    Rank: Member

    So in example, I do want the different colors for each line as specified. If it’s true when you say “Even using the right method, last in will win as the final result”, then why did all the text change to the first color of ‘Magenta’? Since Blue was the last color set after the function ends, shouldn’t all of the text be Blue?

    Edit: I just saw my bug. In this part, I see I used .Text+= instead of .AppendText():

    Once I changed it to this:

    Now it’s working.

    in reply to: Compare-Object with different property names #90230
    Participant
    Topics: 13
    Replies: 15
    Points: 85
    Rank: Member

    Whaaa??? I was using Select-Object yesterday to rename the Property to no avail. I restarted my computer this morning and Wahla, it works. I don’t know……it’s voodoo, haha. Thanks.

    in reply to: Dynamic logging #89915
    Participant
    Topics: 13
    Replies: 15
    Points: 85
    Rank: Member

    Don – Yes I want to condense the 2 if statements into 1. So I want to only use 1 if block and somehow use the string HomeDirectory if the variables $HDServer and $New$HDServer were use. Then use the string ProfilePath if the variables $PPServer and $NewPPServer are used.

    postanote – Yea I figured. I tried for about a week and couldn’t figure out it would ever work. I was thinking I might be able to use ParameterSets, but couldn’t figure it out. If it can’t be done, I’m fine with that. Just wanted some expert input to see if it was possible.

    in reply to: Only display OU without CN #77964
    Participant
    Topics: 13
    Replies: 15
    Points: 85
    Rank: Member

    Thanks Paul. That’s exactly what I needed. I’m reading about regex, so I can understand what you did.

    in reply to: Only display OU without CN #77935
    Participant
    Topics: 13
    Replies: 15
    Points: 85
    Rank: Member

    The output is in reverse when I get the results:

    in reply to: Only display OU without CN #77865
    Participant
    Topics: 13
    Replies: 15
    Points: 85
    Rank: Member

    I am supposed to query our AD structure to find specific OU’s with a given name. Based on the DN of that search, I do not want to see certain OU’s with another set of names. Then I want to get a count of all the computer objects in the OU’s based on the previous results. I was gonna use the Group-Object cmdlet to do this. When I group it, I see the CN’s of the DN’s. I just want to see the OU path.

Viewing 15 posts - 1 through 15 (of 15 total)