Quick script  that I put together to Shutdown my VMware Server VM, copy it to a different spot, and then start it again. It  sends me an email in the end to let me know that the script ran. Using: vmrun.

Click HERE to see.

PS: Create new user in VMWare Server for backup purposes with specific permissions. Then modify the script.

I’ve been for quite some time studying Android programming, creating simple applications based on tutorials around the net. If you want to create apps for Android devices, for sure you have to start with JAVA, but… well… as soon as you start your research, you will find out about App Inventor for Android by Google. If you do not know anything about programming, and go over the documentation and follow a few tutorials for App Inventor, you will be creating “simple” applications pretty much very quickly, there are limits but … you can read about those.
After I went thru all the tutorials I could find on this topic, I got a request to create a simple application that Calculates Sale Price of a product for sale, based on specific chosen percentage Markup. Nothing complicated, I just had to find out mathematical equation that can do that and get a few blocks doing certain tasks.

So here it is for download… Calculate Sell Price. If you work for some Stores out there, and you are a person in charge of prices, it can be helpful.

If you are looking for info about FSRM then you might want to check out Microsoft website HERE first.

Some of you might be using it in your environment, so probably when you will be migrating data to some other server(s) then you would like to for sure migrate your Quota and File Screen templates quickly.

You will need to use DIRQUOTA and FILESCRN tools to perform those tasks.

Example of DIRQUOTA export/import command:

 dirquota template export /File:d:\DirQuotaTemplate.xml 
 dirquota template import /File:d:\DirQuotaTemplate.xml 

Example of FILESCRN export/import command:

 filescrn template export /File:d:\FileScrnTemplate.xml 
 filescrn template import /File:d:\FileScrnTemplate.xml 

I had to lately migrate some hidden shares from one server to another.
I wanted to use “File Server Migration Wizard”, but could not, as Windows 2008 R2 Standard edition will not let you do it, because you do not run enterprise or data-center edition. I got a little annoyed about this and quickly googled for solution. I found the solution described below here posted by Doug_H.

First thing, copy your folders, just use ROBOCOPY to do it for you and it will copy your security attributes too, like in example below:

SET _source="\\server01\d$\Users"
SET _dest="D:\Users"
SET _what=/COPYALL /B /SEC /MIR
SET _options=/R:0 /W:0 /LOG:C:\temp\Users_log.txt /NFL /NDL
ROBOCOPY %_source% %_dest% %_what% %_options%

Then we share the folders. My share names are the same as folders names, and hidden $.
So first you populate a file with the folder names, use cmd:

 DIR /A:D /B > c:\temp\dir_list.txt 

and then you query thru the file and use net share to share your folders with permissions you want like in example below:

 for /F %%X in (c:\temp\dir_list.txt) do (net share %%X$=d:\Users\%%X /GRANT:AdminGroup,FULL /GRANT:%%X,CHANGE) 

The command above has to be run in .bat file, so you need to create one, for example: sharefolders.bat and have the command entered in there, then you run it.

And we are done. Pretty simple, obvious and useful, so sharing.

I know, I know… why don’t you just go to the Illinois Lottery website and check the numbers? Yes you can, but as I am playing with Powershell and looking for something interesting to do and research, I got this idea (It came to me after I checked my ticket and realized that I did not win anything, again.) to create a script to get all info I needed from Illinois Lottery website and send it to my email. The sending email portion is not in this piece of code, but this part you can figure out on your own :) , and you can even probably send the final output thru some SMS gateway.
You can schedule it to run on daily basis. The Illinois Lottery website is updated ~one hour after the numbers are picked.

Here is the Code.

One way of doing it.

I like the way it is done. I hope this will be useful to someone, and you can use it in a lot of ways.
You can fin it here: ConvertTo-HTML example

Good luck :)

Recently I had to setup a system that would let me know if my servers, switches, printers are up and running. Any more information that I could get from the monitoring system would be a huge PLUS. Status of the services, hard drive sizes, memory usage, Uptime, CPU Usage, Printers status, etc… if anything happens, then system sends me an email so I could start troubleshooting the problem shortly after error/issue occures.
I looked as always for a system that could be open source, community supported and the best in what it supposed to do.

I found NAGIOS.

If you look for somthing free, this is the best thing you can get there, as far as I am aware at this moment.
You can install/configure a lot of different plugins that will allow NAGIOS to monitor a lot of different devices.

Easily, once installed, you can configure monitoring of your servers, printers, switches, using Templates/Examples that are included.

One of the problems that I had to look into was monitoring of CANON printers, and properly modifying Nagios config files for that:
Once you understand a little how NAGIOS works you will understand what I am trying to show you here in example:

in /usr/local/nagios/etc/objects/commands.cfg I added a command:

define command{
          command_name check_snmp_canon
          command_line $USER1$/check_snmp -H $HOSTADDRESS$ -l STATUS -C public $ARG1$ $ARG2$
          }

then in: /usr/local/nagios/etc/objects/printer.cfg you define host and service like this:

define host{
          use          generic-printer
          host_name    SOMECANONPRINTER
          alias        SOMECANONPRINTER Alias
          address      "IP of the printer goes here"
          hostgroups   network-printers
          }
define service{
          use                   generic-service
          host_name             SOMECANONPRINTER
          service_description   Printer Status
          check_command         check_snmp_canon!-o hrDeviceStatus.1 -r "2|3"
          normal_check_interval   10
          retry_check_interval  1
          }

That should work. Make sure you check file configuration the way Nagios suggest to do it, before you attempt to restart nagios.

Right now, I am in a process of configuring a plugin that will allow me to use data that Dell Openmanage gathers on server, and once there is something wrong with hardware nagios will notify me. If you interested in looking into it then take a look at this link.

PS:.
There is one cool product out there: Microsoft System Center Operations Manager. Once I get my hands on it, and will have a chance to play in the system I will write probably a few good words about that.

The time has came, it is now time to migrate one of my File Servers from Microsoft Windows Server 2003 Enterprise to a new server with Microsoft Windows Server 2008 Enterprise. I want to migrate all my shares including share and folder permissions. To minimize time spent on this project I had to find a tool that could do it for me fairly easily. I know that there are tools you can purchase online that can do this for you, like for example: “Secure Copy”, but who wants to spend money those days for such a tools, and as always there are for sure alternative free tools somewhere out there to do it for you. After googling for a minute, I found a tool that Microsoft created for us for this scenario: “Microsoft Server Migration Toolkit“.
You can install it on your new Windows Server 2008 and run a File Server Migration Wizard that will guide you thru the whole process. One thing to mention is that, this tool is not perfect, unless I was maybe doing something wrong :)
When you add your shares, from a specific server, you have to make sure that for each share you check, the appropriate “Target Volume” is set, including share name and share location. If you will not do it, the shares copied will not be as identical as on your original server. Correcting each share might take some time, it all depends on how many of them you have.

So If you don’t want to bother to copy folders, and share them again, and set permissions on those folder again manually for a few hours, you can use that tool and save some time.

File Server Migration Wizard

File Server Migration Wizard

Or… You can always read this HOWTO
.

Calling Powershell scripts (.ps1) using Batch (.bat) files. As you can tell, I have SomeScript.ps1 in the same directory as .bat file I launch.

"C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe" -File "%~dp0SomeScript.ps1"

… and when I goolged, there were some other solutions as well for this… This way works for me so far.

The idea was to call any powershell script (.ps1),  located in the same folder as that .vbs script:

Code:

Dim sCurPath
sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
'WScript.Echo sCurPath

Set objShell = CreateObject("Wscript.Shell")
objShell.Run("powershell.exe –noexit &'" & sCurPath & "\SomeScript.ps1'")

I hope it helps someone.

Locations of visitors to this page