You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using /u[\w]*: would be more robust. Thanks to @guyrleach for the find!
$s1="net use * \\acme\f1 /user:acme\itadmin"$s2="net use * \\acme\f1 /use:acme\itadmin"$s3="net use * \\acme\f1 /us:acme\itadmin"$s4="net use * \\acme\f1 /u:acme\itadmin"$s1|Select-String-Pattern "/u[\w]*:","-AsPlainText"-AllMatches
$s2|Select-String-Pattern "/u[\w]*:","-AsPlainText"-AllMatches
$s3|Select-String-Pattern "/u[\w]*:","-AsPlainText"-AllMatches
$s4|Select-String-Pattern "/u[\w]*:","-AsPlainText"-AllMatches
----# OUTPUT # ----
net use * \\acme\f1 /user:acme\itadmin
net use * \\acme\f1 /use:acme\itadmin
net use * \\acme\f1 /us:acme\itadmin
net use * \\acme\f1 /u:acme\itadmin
When using
net use
the following are all valid:However, only the first
/user:
is being detected currently. Via quick testing it looks like changing the search pattern to/u.*:
may be a good fix...The text was updated successfully, but these errors were encountered: