Quantcast
Channel: Exchange Server 2013 - Outlook, OWA, POP, and IMAP Clients forum
Viewing all articles
Browse latest Browse all 10580

bat file to vbs

$
0
0

Hi I'm an IT Technicnian at a Secondary School (Middle/Highschool)

We have had a few issues with our Exchange server and Outlook Profile accounts, basically the Exchange Server was rebuilt with a newer version of Exchange but with the same exchange server address. So when users launch outlook it comes up with a box which says "server not found" with buttons retry, work offline, cancel. To fix this you go into control panel click mail, then show profiles and remove the old profiles, then launch outlook again and hey presto the Wizard comes up and users can click next and it auto sets the exchange details and outlook is back up. The thing is the Systems manager wants this process automated, because he left a help guide on our main sharepoint SLG sitepage (home page for IE) but nobody reads the dam thing!!!

Anyways to counter this I created a bat file using the internet and a bit of my own input (I'm a noob at scripting) so I created the below bat file because it basically replicates the control panel removing of outlook profiles.

setlocal ENABLEDELAYEDEXPANSION
 
for /f "skip=4 tokens=*" %%a in ('reg query ^"HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles^"') do (
 reg query "%%a" /v OutlookProfiler
 if !errorlevel! equ 1 reg delete "%%a" /f
 )

\\pdc\NETLOGON\regedit.exe /s \\pdc\NETLOGON\bob.reg

\\pdc\NETLOGON\regedit.exe /s \\pdc\NETLOGON\bob2.reg

-------------------------------------------------------------------------

The bat works a charm, the only problem is it doesn't work for students. So I tried using GPO which apprently is easier, and I basically set up a new GPO policy which a registry change with orders of deleting , and creating the 2 reg files above (called it bob because it would be easy to identify). It worked for staff, but students it didn't work.

So what I want to know is there away of converting the above bat to a vbs and will the vbs bypass security so it works for students as well?

If you could get back to me it would be a big help

Lounds


Viewing all articles
Browse latest Browse all 10580

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>