Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerShell only for Server 2012+ #28

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

ruddj
Copy link

@ruddj ruddj commented Aug 24, 2017

A powershell version that uses the native powershell FSRM commands.
It is designed to allow it to be easily run automatically from a scheduled task.
This would more be an alternative or branch version rather than replace original as the FSRM powershell commands do not exist for Server 2008 / 2008 R2

Changes:
Replaced filescrn.exe with Powershell commands to remove the depreciated warnings.
Added support for a proxy server between script and web
Changed to more compatible Write-Output statements to allow redirection of output for logs
Made skip list defined variable as needs to be full path when run as scheduled task.
Added Transcript option to create log files of run.

…be easily run from a scheduled task.

Replaced filescrn.exe with Powershell commands to remove the depreciated warnings.
Added support for a proxy server between script and web
Changed to more compatible Write-Output statements to allow redirection of output for logs
Made skip list variable as needs to be full path when run as scheduled task.
Added Transcript option to create log files of run.
@davidande
Copy link

I also use fsrm commands on my scripts

Added existence test for file shares before attempting to add them
@nexxai
Copy link
Owner

nexxai commented Aug 28, 2017

Before I merge, I have a question for the community: should we be creating a separate method of storing personal preferences (registry/config file/etc) since manually editing the .ps1 files will get overwritten the next time the script is updated.

And if separate is the way to go, what do people prefer?

My personal preference (and absolutely NOT necessarily the way we will go, just my personal insight) would be to have the script either prompt on first run for the necessary values and dump them into the registry somewhere to be read back later, or allow command-line switches to overwrite the stored values.

The downside to this is that the script may break for a certain number of people if they have a git clone set up to automatically get the latest version of the script before running, since when the change is made, the script will be sitting there waiting for user input and never go anywhere.

Thoughts?

@ruddj
Copy link
Author

ruddj commented Aug 28, 2017

The best way may be to define the entire script and options the proper powershell way with defined parameters. I would much rather that than registry entries as in my case we run the script from a shared UNC path and have a failover cluster scheduled task run it once a week. This means it runs from multiple servers with no user interaction.

I will work on making it a proper powershell module and post updated pull soon. Cheers,

Still need to add Mail To, Subject and Body entries.
Fixed bug assigning $false to string for ProxyHost
@ruddj
Copy link
Author

ruddj commented Sep 4, 2017

Hopefully this should have parameterised all the options.

@JustinCochran
Copy link

JustinCochran commented May 25, 2018

Would it be possible to then put in a parameter called "FirstRun" or something like that.
If the Parameter is set then it will verify that FSRM is installed and also setup the Server Options (E.G. SMTP Server, Default Admin Recipients, Default From Recipient)
Then if the parameter is not set the script would just run the update portions. Could speed up the process.

@nexxai
Copy link
Owner

nexxai commented Oct 10, 2018

@ruddj I am extremely sorry - I'm not sure how I missed this PR, but if you can resolve the conflicts, I will merge it immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants