Comparing PowerShell to Linux User Manipulation
-
@WrCombs said in Comparing PowerShell to Linux User Manipulation:
Hey sorry to interrupt.
Why was I tagged in this?
just curious /Because he branched off of a question you had initially asked about "how would this look in Linux". But went way off on a tangent, so it was forked.
-
@WrCombs said in Comparing PowerShell to Linux User Manipulation:
Hey sorry to interrupt.
Why was I tagged in this?
just curious /If you look at the bottom of the OP, he tagged you to show you that the New-LocalUser command will prompt for an interactive password after you run it if you don't do anything else, but that was in my original post already, so not sure why it was mentioned.
-
@scottalanmiller said in Comparing PowerShell to Linux User Manipulation:
@WrCombs said in Comparing PowerShell to Linux User Manipulation:
Hey sorry to interrupt.
Why was I tagged in this?
just curious /Because he branched off of a question you had initially asked about "how would this look in Linux". But went way off on a tangent, so it was forked.
Ah, Thanks.
Yeah i was just curious how the two syntaxs were different Because @StuartJordan (i think )
said "using Bash" instead of Using Linux CLI to do the same thing as powershell looked better. I remember now . -
@WrCombs said in Comparing PowerShell to Linux User Manipulation:
Yeah i was just curious how the two syntaxs were different Because @StuartJordan (i think )
said "using Bash" instead of Using Linux CLI to do the same thing as powershell looked better. I remember now .It's a little confusing, which Ob alluded to but didn't point out too much and is a valid point that he should have made, is that on the Linux side some of what we are using is Bash, and some of what we are using is user management commands.
This is definitely part of the downside to the Linux approach is that sometimes you have a tool, and sometimes you are manipulating a text file. Both are easy, but they are very different. Of course, technically that is optional, it wasn't that long ago that we didn't use the tools and we just edited the text files. It's not hard, but it is unnecessarily hard and would look pretty foolish today if it was the only approach.
But some tasks don't quite have an alternative, because the text file is so easy. Like Ob's example of "getting all users". You just read the whole table and there it is. But this creates a "half the stuff one way, half the stuff another way" problem which, while each task is easy, isn't consistent. PowerShell makes it all consistent, but all more complicated.
In PS, everything is a unified commandlet, and nothing is "interact with the OS directly." In Linux, there are tools for some tasks, and others you just work with the OS' files. It would be nice to see Linux bridge that gap with a unified management toolset at some point.
-
@scottalanmiller said in Comparing PowerShell to Linux User Manipulation:
@Obsolesce said in Managing Windows Local Users with PowerShell:
@scottalanmiller said in Managing Windows Local Users with PowerShell:
That simple.
Not as simple as, simply
glu
.Actually, it's way simpler than memorizing obtuse, non-obvious abbreviations which you need a different one for every form, of every task.
I personally never use aliases, even though I memorize most of the common ones because they are usually the first letters of each word. I mentioned that for the silly people who are counting command characters. Who gives a shit between the difference of typing
New-LocalUser
vsadduser + passwd
. It's simple enough, and if you are typing those a lot, it's about time you make yourself useful and learn to script and automate.... or change how you manage local users, for example. -
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
and if you are typing those a lot, it's about time you make yourself useful and learn to script and automate
That's easy to say, but there are tons and tons of people out there who use these all day, every day, but cannot automate because they aren't in a uniform environment. Remember the biggest Windows admin group is MSPs, not "single customer environments" and quite an astounding volume of Windows management by industry percentage is done through tools that require environmental-less remote command execution, use CMD not PS (at least by default), and cannot have newer PS versions, and cannot have an automation toolset of any significance.
I'm sure that there are automation ideas out there even for MSPs. But when you manage thousands of totally disconnected Windows desktops, what is there to automate? Having fast, simple tools that are universally available is about the best that you can do.
-
@scottalanmiller said in Comparing PowerShell to Linux User Manipulation:
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
and if you are typing those a lot, it's about time you make yourself useful and learn to script and automate
That's easy to say, but there are tons and tons of people out there who use these all day, every day, but cannot automate because they aren't in a uniform environment. Remember the biggest Windows admin group is MSPs, not "single customer environments" and quite an astounding volume of Windows management by industry percentage is done through tools that require environmental-less remote command execution, use CMD not PS (at least by default), and cannot have newer PS versions, and cannot have an automation toolset of any significance.
I'm sure that there are automation ideas out there even for MSPs. But when you manage thousands of totally disconnected Windows desktops, what is there to automate? Having fast, simple tools that are universally available is about the best that you can do.
If they are mostly all managing local users, no usable PowerShell, no automation, etc, then why are they using Windows in the first place?
-
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
If they are mostly all managing local users, no usable PowerShell, no automation, etc, then why are they using Windows in the first place?
None of those are reasons why people choose Windows. People choose Windows primarily because of app compatibility or familiarity with the GUI environment for end users. If IT alone chose an OS for their own purposes, Windows would never be considered at all, it just doesn't make sense in that way (nor does choosing something in that way.) In fact, MS automation has always been a weak point, so if anything, lacking an ability or need for automation would make the argument for choosing Windows stronger, not weaker.
But you are also defining PowerShell as "usable" based on extremely new versions. Maybe this is true, but keep in mind that your argument basically is that PowerShell has been a failure for a decade.
-
It interesting to think about, one complaint about Linux is that it has fragmented off into tons of different distributions, however it's has managed to keep a lot of the tools standardized across them all.
-
@flaxking said in Comparing PowerShell to Linux User Manipulation:
It interesting to think about, one complaint about Linux is that it has fragmented off into tons of different distributions, however it's has managed to keep a lot of the tools standardized across them all.
That's very true. It's even moreso than that. Many of those tools remains standard across not just operations systems, but OS familys, too. AIX, Solaris, BSD, Linux... all those families tend to share a lot of tooling.
-
@scottalanmiller said in Comparing PowerShell to Linux User Manipulation:
@flaxking said in Comparing PowerShell to Linux User Manipulation:
It interesting to think about, one complaint about Linux is that it has fragmented off into tons of different distributions, however it's has managed to keep a lot of the tools standardized across them all.
That's very true. It's even moreso than that. Many of those tools remains standard across not just operations systems, but OS familys, too. AIX, Solaris, BSD, Linux... all those families tend to share a lot of tooling.
It's because the tools aren't linux, it's GNU. Gnu is Not linUx.
-
@Pete-S said in Comparing PowerShell to Linux User Manipulation:
It's because the tools aren't linux, it's GNU. Gnu is Not linUx.
Not GNU. The tools predate Gnu. Gnu remade many of them and they are often used across some of those groups, like Linux and BSD, but rarely in others like AIX.
It's more of just standards.
-
@scottalanmiller said in Comparing PowerShell to Linux User Manipulation:
And you conveniently left out that almost no Windows has this PowerShell stuff, it's non-standard! Only extremely current versions have this without having to go through hoops to install it extra. This isn't universally workable for PowerShell.
WTF? What version of Windows are you claiming here? Because PowerShell has been install by default since Windows 7 (PowerShell version 2.0).
-
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
Create a New Local User
New-LocalUser salty #PowerShell - super simple, automatically prompts for password
useradd sally #BASH - simple
passwd p@ssw0rd #BASH - simple, insecureWTF? Insecure? Are you fucking stupid?
Also the correct syntax is
passwd salty
and guess what, it prompts you to enter the password.How about that, it is not any different between the two systems.
-
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
List Local Users
Get-LocalUser #PowerShell - simple.
Cat /etc/passwd | grep "/bin/bash" #BASH - good luck!As @scottalanmiller already stated, you don't even know what you are trying to compare here as you, again, used incorrect syntax.
grep salty /etc/passwd
Real life results from my laptop. Simple colon delimited output.
[jbusch@lt-jared ~]$ grep jbusch /etc/passwd jbusch:x:1103:1103:Jared Busch:/home/jbusch:/bin/bash [jbusch@lt-jared ~]$
-
@JaredBusch said in Comparing PowerShell to Linux User Manipulation:
@scottalanmiller said in Comparing PowerShell to Linux User Manipulation:
And you conveniently left out that almost no Windows has this PowerShell stuff, it's non-standard! Only extremely current versions have this without having to go through hoops to install it extra. This isn't universally workable for PowerShell.
WTF? What version of Windows are you claiming here? Because PowerShell has been install by default since Windows 7 (PowerShell version 2.0).
And Powershell 2.0 is missing a lot of stuff that are taken for granted by Powershell users today. If WMF was made available through Windows updates, that would have made life easier.
-
@JaredBusch said in Comparing PowerShell to Linux User Manipulation:
@scottalanmiller said in Comparing PowerShell to Linux User Manipulation:
And you conveniently left out that almost no Windows has this PowerShell stuff, it's non-standard! Only extremely current versions have this without having to go through hoops to install it extra. This isn't universally workable for PowerShell.
WTF? What version of Windows are you claiming here? Because PowerShell has been install by default since Windows 7 (PowerShell version 2.0).
Who said PowerShell wasn't there? The mistake is thinking that PowerShell does any of the work, it doesn't. CmdLets do. And the CmdLets that do the work aren't part of the PowerShell packages on Windows 7. You can add them manually, just like you can add different versions of PowerShell. But the PS and PS ecosystem that are part of Windows 7 lack the functionality being discussed, like user and group management. You can write really obtuse, lengthy code to do it, but it is absurd and totally impractical.
-
@flaxking said in Comparing PowerShell to Linux User Manipulation:
@JaredBusch said in Comparing PowerShell to Linux User Manipulation:
@scottalanmiller said in Comparing PowerShell to Linux User Manipulation:
And you conveniently left out that almost no Windows has this PowerShell stuff, it's non-standard! Only extremely current versions have this without having to go through hoops to install it extra. This isn't universally workable for PowerShell.
WTF? What version of Windows are you claiming here? Because PowerShell has been install by default since Windows 7 (PowerShell version 2.0).
And Powershell 2.0 is missing a lot of stuff that are taken for granted by Powershell users today. If WMF was made available through Windows updates, that would have made life easier.
Exactly. PS on Windows 7 basically requires that you either: add in lots of extra stuff that isn't native, use PS in a totally useless way just to prove a point, or fall back to traditional tools called through PS like the net commands. PS was functional in Windows 7 the same way that CMD was functional there... which is to say moderately, but not fully.
-
@JaredBusch said in Comparing PowerShell to Linux User Manipulation:
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
List Local Users
Get-LocalUser #PowerShell - simple.
Cat /etc/passwd | grep "/bin/bash" #BASH - good luck!As @scottalanmiller already stated, you don't even know what you are trying to compare here as you, again, used incorrect syntax.
grep salty /etc/passwd
Real life results from my laptop. Simple colon delimited output.
[jbusch@lt-jared ~]$ grep jbusch /etc/passwd jbusch:x:1103:1103:Jared Busch:/home/jbusch:/bin/bash [jbusch@lt-jared ~]$
That's listing a single user, the context was listing all local users.
-
@JaredBusch said in Comparing PowerShell to Linux User Manipulation:
@Obsolesce said in Comparing PowerShell to Linux User Manipulation:
Create a New Local User
New-LocalUser salty #PowerShell - super simple, automatically prompts for password
useradd sally #BASH - simple
passwd p@ssw0rd #BASH - simple, insecureWTF? Insecure? Are you fucking stupid?
Also the correct syntax is
passwd salty
and guess what, it prompts you to enter the password.How about that, it is not any different between the two systems.
Shit yeah I did know that.
Still, it's two commands, versus one with PowerShell, unless you write a long one-liner in BASH.