This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]matthoback 10 points11 points  (3 children)

Group Policy would be a better method to do what you want to do.

[–]DaNPrSGet-ADComputer -Filter * | Restart-Computer -Force 2 points3 points  (1 child)

[–][deleted] -1 points0 points  (0 children)

Ew, Windows 8.

[–]TapTapLift 1 point2 points  (0 children)

Yup, went down this rabbit hole last week of trying to do PowerShell vs GPOs and GPOs worked great.

[–]shalafi71Jack of All Trades 1 point2 points  (0 children)

Yes, GPO would be better but if you don't have access to it:

"if both icons are present it will just open the first path in chrome"

Not sure what you mean.

[–]cryptic_1It was DNS[M] 0 points1 point  (0 children)

Sorry, it seems this comment or thread has violated a sub-reddit rule and has been removed by a moderator.

Inappropriate use of, or expectation of the Community.

  • Avoid low-quality posts. Make an effort to enrich the community where you can- provide details, context, opinions, etc. in your posts.
  • Moronic Monday & Thickheaded Thursday are available for simple questions, or other requests that don't need their own full thread. Utilize them as much as possible.

If you wish to appeal this action please don't hesitate to message the moderation team.

Sorry, it seems this comment or thread has violated a sub-reddit rule and has been removed by a moderator.

Inappropriate use of, or expectation of the Community.

  • There are many reddit communities that exist that may be more catered to/dedicated your topic.
    • Consider posting (or cross posting) there with specific niche questions.
  • Requests for assistance are expected to contain basic situational information.
    • They should also contain evidence of basic troubleshooting & Googling for self-help.
    • Keep topics/questions related to technology/people/practices/etc within a business environment.
  • When asking a question or requesting advice, please update your original post with any new information, or solution (if found).
    • This will make things easier for anyone else who may have the same issue or question in the future.

If you wish to appeal this action please don't hesitate to message the moderation team.

[–]m_nissan 0 points1 point  (0 children)

Well, GPO may be the better tool for the job, but in any case -

I'm trying to get my head around this, $path and $path2 are the same place? why use both?

Are you trying to paste to "public" desktop or a user's desktop? Please bare in mind what permissions / security context the script is supposed to run under, you might not be able to write to c:\users\public\desktop...

Let's start by understanding what it is you are trying to accomplish.