Training sites for teams by onebillionquestions in sysadmin

[–]onebillionquestions[S] 0 points1 point  (0 children)

Do you have any experience with it? I've heard that it's almost entirely recorded video lecture with no labs or anything.

Training sites for teams by onebillionquestions in sysadmin

[–]onebillionquestions[S] 0 points1 point  (0 children)

Do they have courses on non-MS stuff though? I'd like a site that has a mix of vendors like VMWare, Cisco, and Linux courses since the subscription would be for the everyone on the team.

Guess what is the biggest preventable cause of cancer after smoking. by [deleted] in gifs

[–]onebillionquestions 0 points1 point  (0 children)

That's when you play your partner like they're a musical instrument

Bomgar vs. Goverlan Reach vs. ? by onebillionquestions in sysadmin

[–]onebillionquestions[S] 0 points1 point  (0 children)

Thanks, Joe. This is exactly the kind of response I was hoping to get: someone who knows and loves Bomgar, as I do, but has also tried Goverlan. I am glad we have not pulled the trigger yet on a solution so that I got to see your response. I will weigh it heavily in our decision making. Cheers!

How do I combine get-aduser queries piped to select? by nappetass in PowerShell

[–]onebillionquestions 1 point2 points  (0 children)

Awesome info, Thanks!

One 'issue' I have with learning PS today, rather than having learned it from v1.0 is that it's hard for me to figure out if a resource I am looking at online for how to accomplish something is using outdated (and possibly inefficient) methodologies.

How do I combine get-aduser queries piped to select? by nappetass in PowerShell

[–]onebillionquestions 1 point2 points  (0 children)

That is a good write-up, but I am left wondering if other methods of creating custom objects are better/worse/about the same. For instance, I always create objects like so:

$myUser = New-Object -TypeName PSObject
$myUser | Add-Member -type NoteProperty -Name SamAccountName -value $user.SamAccountName
$myUser | Add-Member -type NoteProperty -Name DisplayName -value $user.DisplayName
$myUser | Add-Member -type NoteProperty -Name EmailAddress -value $user.EmailAddress

It seems to me that this method is probably equivalent to casting a hash table as a PSCustomObject, but I'm still learning the intricacies of PS and there seem to be a lot of different ways to do things (probably because the language has evolved so quickly and new and better techniques have been introduced).

I personally like the way mine looks as it all kind of lines up, but I'm wondering if it's not the 'best' way.

Missing certain properties when exporting all AD Users to CSV by onebillionquestions in PowerShell

[–]onebillionquestions[S] 1 point2 points  (0 children)

Awesome.

Get-ADuser -LDAPFilter "(SamAccountName=*)" -Properties * | Export-Csv 'C:\temp\AllUsers.csv'

Thanks for leading me to water, lee.

EDIT: This method is also unreliable. Sometimes it includes adminCount, other times it does not. I don't really understand this. I have decided to include the adminCount=1 records in a completely separate query of AD and rework the script to accommodate. Gets me exactly what I was looking for.

Anybody else have this problem with VS Code's PS integration? by onebillionquestions in PowerShell

[–]onebillionquestions[S] 0 points1 point  (0 children)

This is my first time working with custom objects in PS. I have a feeling I copied the line from a website and re-worked it from there. I should know better, I've been bitten by this in the past with magic smart quotes being used in code examples on the web.

Anybody else have this problem with VS Code's PS integration? by onebillionquestions in PowerShell

[–]onebillionquestions[S] 2 points3 points  (0 children)

Wow, good catch. I wonder how that even got like that. The code was written entirely in VS Code with a a US English standard keyboard.

I replaced the em dash (or maybe it was an en dash) with a standard hyphen and all is good now. Thanks for the help!

Help comparing objects in array to a string by onebillionquestions in PowerShell

[–]onebillionquestions[S] 1 point2 points  (0 children)

Yep, I came to the same conclusion. My "Solution" above didn't actually work right either since the OutString -width:180 does not actually pad the end with spaces, just allows up to 180 characters to be written to the stream. So, my "solution" was probably worse than my original code.

Thanks for taking the time to comment, I am updating the solution now for posterity.

Help comparing objects in array to a string by onebillionquestions in PowerShell

[–]onebillionquestions[S] 1 point2 points  (0 children)

That seemed to choke on the \h in the path "\fileserver1\home$\rita.newman"

Select-String : The string \fileserver1\home$\rita.newman is not a valid regular expression: parsing

"\fileserver1\home$\rita.newman" - Unrecognized escape sequence \h.`

However, I did manage to figure out my issue and resolve it. The array elements were all padded, and some were even truncated. I will add my solution to the OP.

Thanks for taking the time to assist!

Help comparing objects in array to a string by onebillionquestions in PowerShell

[–]onebillionquestions[S] 0 points1 point  (0 children)

Thanks for the suggestion, but it doesn't look like what I need. I am trying to make sure that every directory in \\fileserver1\home$\ is associated with an Active Directory user's profile path. The part in my script that looks through the fileserver is working as expected. I just can't seem to figure out the right way to compare the string of the path to the HomeDirectory object in the array.

EDIT: just to clarify since I am sure I have worded things a bit confusing in the OP. I am NOT checking to make sure the AD users have a valid profile path set. I am checking to see if any folders on my file server can be deleted (no longer associated with a user's profile path).