Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all 15028 articles
Browse latest View live

Need to extract the string in the next line after the matched pattern or string using vbscript

$
0
0
Got an adhoc task to get some fields to be extracted from xml.

The values that are in the next line of the following patterns or strings need to be extracted and printed from the below xml

a.Item Domain (i.e xyx.domain.com)
b.Item IP address(i.e xxx.xxx.xx.x port 0000)
c.Item Serial # (i.e 9090909090)
d.Client Item IP (i.e yyy.yyy.yyy.yy)
e.Client Logged In As (i.e user9)
f.Item user is member of (i.e AE\DERT_NRD_PPO-KIL_Def,AE\Item users)

</script>

<h2>Item Information</h2>

<dl>
  <dt>Item Domain</dt>
  <dd>xyx.domain.com</dd>
  
  <dt>Item IP address</dt>
  <dd>xxx.xxx.xx.x port 0000</dd>
  
  <!--
  <dt>Item Class</dt>
  <dd>Class 5.4.0</dd>
  -->
  
  <dt>Item Serial #</dt>
  <dd>9090909090</dd>
  
  <dt>Client Item IP</dt>
  <dd>yyy.yyy.yyy.yy</dd>
  
  <dt>Client Logged In As</dt>
  <dd>user9</dd>
  
  <dt>Item user is member of</dt>
  <dd>AE\DERT_NRD_PPO-KIL_Def,AE\Item users</dd>
  
</dl>

And the output should be in the below format delimited with "|"

xyx.domain.com | xxx.xxx.xx.x port 0000 | 9090909090 | yyy.yyy.yyy.yy | user9 | AE\DERT_NRD_PPO-KIL_Def,AE\Item users


Microsoft Dynamic CRM Deployment Manager - Set Binding Type Using Script

$
0
0

Hi Guys, 

I want to ask, is it possible set Binding Type as Https using powershell script ? And if it possible , can I change also portname for Web Application Server, Organization Web Service, Discovery Web Service and Deployment Web Service on it?

FYI, i knew it well how to configure it from UI. 

Thank you for your answer, And sorry for my bad English. 

Hi team

$
0
0

i have applied this below script...i need help preventing save on document & folder & c drive.

after applying script how to revert back to original state.

please do the needful

Regards,

Madhu

Need to append a .txt file using powershell

$
0
0

I'm looking for a powershell script which will delete the lines starting with test "xyz" and will add few line at last of same. I'm not allowed to create a new file how can I do this?

i've written a small code here which works good but creates new file, I'm looking if i want to use foreach loop how will i do that & without creating any new file.

Get-Content c:\test\in.txt | Where-Object {$_ -notmatch 'how'} | Set-Content c:\test\in.txt 

$a="this is new cobntent added"
Add-Content c:\test\out.txt $a


Quick question about -eq and arrays

$
0
0

So i am writing a skript everything is working except one thing: I used

$variable = Get-Content C:\blablabla\bla.txt

this .txt file has 19 mail addresses

now i want to look into my AD and filter through those 19 mail adresse

but i have problems with the -eq and array

i tried t couple if things but i am kinda stuck.... here the filter : -filter {(mail -eq $variable[1])} 

(ofc i want to put that into a loop later but i know how to do  loops)


Integrate timeout on Powershell command?

$
0
0

Hi,

I have this command to an RDS-broker which makes my Powershell lock completely. The broker has some issues and that's the root cause of this (it is reachable so a test-connection is useless). There doesn't seem to be a timeout on the command buit-in so I'd like to throw an error after f.e. 5 minutes.

Please advise howto approach.
J.


Jan Hoedt

Modify Regsitry

$
0
0

I'm relatively new at PowerShell and am in need of a little assistance.

I am attempting to modify a registry key through my SCCM OSD task sequence and have come up with the following script;

 

# Modify OLEForRetail Scanner UseService
$registryPath = "HKLM:\Software\OLEforRetail\ServiceOPOS\LineDisplay"
$Name = "UseService"
$value = "VF70-1"

# Modify Registry Hive
    New-ItemProperty -Path $registryPath -Name $name -Value $value `
        -PropertyType DWORD -Force | Out-Null

Unfortunately the registry key is not changing the value and at this point I'm not sure if its the script or the task sequence.


DHeinz

Ipconfig /all to text file

$
0
0

Hello All,

I have a simple batch file.I want to save all ipconfigs in a text and save it in a shared files.I deployed with gpo but didn't work.It works only when i run batch file as admin in my laptop.What can i do?Thanks

ipconfig /all  > \\192.167.1.110\ipconfig\%computername%.txt


Get-ADUser: Not a valid win32 FileTime

$
0
0

Hi Guys,

Requesting for your assistance, this error really bugging. Im not getting this error when applying to an OU with small number of users. But when applying to an OU with large number of Users Im getting the error above. And clueless how to solve it.

Also, Im newbie in powershell and still learing. Im wonder what is the line and Char mean from the error.

Thanks in advance.



#import the ActiveDirectory Module
Import-Module ActiveDirectory
#@{Label = "OU";Expression = {$_.Canonicalname}},
#@{Label = "Manager";Expression = {%{(Get-AdUser $_.Manager -server $ADServer -Properties DisplayName).DisplayName}}},
Get-ADUser -searchbase "ou=Accounts,dc=kamotegroup,dc=internal" -Properties * -Filter * |
                  Select-Object @{Label = "First Name";Expression = {$_.GivenName}},
                  @{Label = "Last Name";Expression = {$_.Surname}},
                  @{Label = "Display Name";Expression = {$_.DisplayName}},
                  @{Label = "Logon Name";Expression = {$_.sAMAccountName}},
                  @{Label = "City";Expression = {$_.City}},
                  @{Label = "State";Expression = {$_.st}},
                  @{Label = "Job Title";Expression = {$_.Title}},
                  @{Label = "Company";Expression = {$_.Company}},
                  @{Label = "Description";Expression = {$_.Description}},
                  @{Label = "Department";Expression = {$_.Department}},
                  @{Label = "Office";Expression = {$_.OfficeName}},
                  @{Label = "Phone";Expression = {$_.telephoneNumber}},
                  @{Label = "Email";Expression = {$_.Mail}},
                  @{Label = "OU";Expression = {$_.canonicalname -replace "/$($_.cn)",""}},
                  @{Label = "Manager";Expression = {%{(Get-AdUser $_.Manager -Properties DisplayName).DisplayName}}},
                  @{Label = "Account Status";Expression = {if (($_.Enabled -eq 'TRUE')  ) {'Enabled'} Else {'Disabled'}}}, # the 'if statement# replaces $_.Enabled
                  @{Label = "Expiration Date";Expression = {$_.AccountExpirationDate}},
                  @{Label = "Last LogOn Date";Expression = {$_.lastlogondate}} |

                  #Export CSV report
                  Export-Csv -Path "C:\HPSA_Script_Results\alladusersAccounts.csv" -NoTypeInformation 

Error:

Get-ADUser : Not a valid Win32 FileTime.
Parameter name: fileTime
At line:6 char:1
+ Get-ADUser -searchbase "ou=Accounts,dc=kamotegroup,dc=internal" -Properties * -F ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-ADUser], ArgumentOutOfRangeException
    + FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.ArgumentOutOfRangeException,Microsoft.ActiveDirectory.Management.Commands.GetADUser



Error Reporting for Object does not exist

$
0
0

I have tried for several days using different variations on error reporting in Powershell, I am new to scripting in shell so bare with me please. I have a script that is grabbing a version number out of a txt file and pairing it with the computer name it came from. but the error I want to see will not go to the outfile correctly. It is either writing the message on every entry or not at all?

I tried to use traps, and/or if statements. My If statements were something to the effect of

If ($error) {
         Write-warning -Message 'bad deal';
         }

What is a basic or best way to do a Object not Found statement on a script layed out like this?

                                                          

$ChrisFile = Get-Content "\\server\s$\powershellscripts\LabMachines\*.txt"  
 $ChrisFile | ForEach-Object  {
$computerName = $_
        $Version = Get-Content "\\$computerName\C$\Chris32\*.txt" 
$Version  | Select-Object `
@{"Name" = "ComputerName"; Expression={$computerName}},
@{"Name" = "Version";         Expression={$Version}}
} | outfile censored.txt

The error I get is 

Get-Content : An object at the specified path \\FY-LAB-00\C$\Chris32\*.txt does not exist, or has been 
filtered by the -Include or -Exclude parameter.
At line:5 char:20
+         $Version = Get-Content "\\$computerName\C$\Chris32\*.txt"
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (System.String[]:String[]) [Get-Content], Exception
    + FullyQualifiedErrorId : ItemNotFound,Microsoft.PowerShell.Commands.GetContentCommand

So I tried error reporting for just that class of error using the .net variable and that was alot of stabbing the air as well for me.Any help or even pointing me to a good help source would be greatly appreciated, the subjects of traps seem over my head on the 2 forums I looked at and the if statements won't work as intended.

Get-Content Where-Object

$
0
0

Hi,

I am running the Get-Content cmdlet to read a text file and search for the contents. If the content is not found, I need to execute an action. I am not sure how to do the latter part.

Get-Content -Path C:\INV.txt | Where-Object {$_ -NotLike '*no rows selected*'}

If I don't find this text "no rows selected" I need to execute an command. Any help will be greatly appreciated.

Thanks

How take ownership of Userprofiles and reassign back to orignal sAMAccountName?

$
0
0

Here is what I was trying to accomplish. I have a DFS server that I gave exclusive rights for folder redirection, in doing so, this caused issues with userprofile restores.

I am trying to take ownership, set permissions on the userprofiles, then give back permissions to the sAMAccountNames. I created the below script on a test box but I cannot figure out how to reassign the folder redirection to the original owner.

takeown -f c:\profiles /a /r
$folders = gci C:\profiles -recurse
 foreach ($folder in $folders)
    {icacls.exe $folder.FullName /inheritance:r /grant *S-1-5-11:"(RX,AD)" /grant *S-1-5-32-544:"(CI)(OI)(F)" /grant *S-1-3-0:"(CI)(OI)(IO)(M)"}

I was hoping to find a way to loop it through the directory as I have over 80+ userprofiles to run this against.

Thank you for any assistance someone could provide.

Powershell and ShortDatePattern information

$
0
0

Greetings,

    The regional settings on my PC (Win7) are set to Australia and in the control panel the 'Short date' is set to 'd/MM/yyyy' as expected.

   Also, as expected, if I run:

   $d = (get-date).toshortdatestring() then the value returned is '5/08/2016'  (5th August)

   However, if I run:

   ([datetime]$d).tostring("yyyy_MM_dd") then the value is '2016_05_08' which is not what I expected.

  Also when I run:

   new-object system.globalization.datetimeformatinfo the value of ShortDatePattern is 'MM/dd/yyyy' - also not as expected.

  All this is part of a script which eventually runs:

   get-messagetrackinglog -start $d ...

  The above fails at it tries to read logs from the 8th of May even though $d is '5/08/2016'. The help for the above cmdlet parameter says:

  'Use the short date format that is defined in the regional options...' but it fails when $d is 5/08/2016 but works if I specify '08/05/2016' as it treats the latter as 5th August.

  I'm wondering what the explanation for the above might be...

Thanks

David

Invoke-SqlCmd Please use the 'var=value' format for defining a new variable

$
0
0

I'm looking for some help with a Powershell script I'm trying to write to replace a SqlCmd batch file. The problem is iwht passing a variable value to the tsql script.

If I pass the variable with no WHERE clause it's ok, runs fine 

$PopulationSQL = "select ssn from employee"

but if I have a predicate

$PopulationSQL = "select ssn from employee where ssn = '123456789'"

It fails: "Invoke-SqlCmd : The format used to define the new variable for Invoke-Sqlcmd cmdlet is invalid. Please use the 'var=value' format for defining a new variable"

In both cases the variable is being passed in the same way

$parameters="PopulationSQL=$PopulationSQL"
Invoke-SqlCmd -Variable $parameters -InputFile $Prepare -ServerInstance $SourceServer -Database $SourceDB 

Any help geatfully apprecaited!


casting to xml by default parsing html tags too

$
0
0

hey guys, 

i have a xml document which contains this 

<?xml version="1.0" encoding="UTF-8"?><web-app><context-param><description>Only applicable if &quot;server&quot; is set to default.</description></context-param></web-app>

$gcXML = Get-Content -Path "C:\temp.xml" # the &quot; are preserved in this stage Write-Output $gcXML # in this stage the &quot; is being parsed as ", which i don't want $xdoc = [xml] $gcXML $xdoc.'web-app'.'context-param'.'description'

# output is (Only applicable if "server" is set to default.)

how can i preserve the  &quot; tag ? 


Is there any possibility to create custom permission & group in SharePoint which can access only to add the users to sharepoint groups

$
0
0

Hi,

Is there any possibility to create custom permission & group in SharePoint  which can access only to add the users to SharePoint groups?

thanks....

Get-DhcpServerv4Lease not recognized

$
0
0
I have been trying every way I know how to get this to run and im not making any ground.  

I just want to write a script that will connect to the dhcp server and save a report of all the clients ip addresses that start with the hostname "Player"

New-PSSession -ComputerName DHCP-Server
Invoke-Command {Get-DhcpServerv4Lease -ScopeId 192.168.0.0 | where{$_.HostName -like 'Player*'} | ft IP*,Host* -auto > \\group\players\Report.txt}

If I run the commands separately, all seems to work fine, but when I put them together in a .ps1 file I get the following error:
The term 'Get-DhcpServerv4Lease' is not recognized as the name of a cmdlet, fun
ction, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At C:\Users\mmaus\TruSignIPReport.ps1:2 char:38+ Invoke-Command {Get-DhcpServerv4Lease <<<<  -ScopeId 192.168.0.0 | where{$_.Ho
stName -like 'Player*'} | ft IP*,Host* -auto > \\group\playertrusign\Report
.txt}+ CategoryInfo          : ObjectNotFound: (Get-DhcpServerv4Lease:String) [
   ], CommandNotFoundException+ FullyQualifiedErrorId : CommandNotFoundException

Powershell to export Access 2010 query to CSV file

$
0
0

I  am trying to use Powershell to connect to a query within an Access database and dump its contents to a CSV file. I am trying to use the Get-DatabaseData function I found on Technet

$FilePath = "\\Fileserver\Share\Database.accdb"
$connect = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=$FilePath;"
$query = "SELECT * FROM [qry QueryName]"

Get-DatabaseData -verbose -connectionString $connect -query $query

When I run the above, I just get a 0 back for results. When I execute the query command within Access, it returns the expected results (i.e. there is actual data to return). Can anyone point me in the right direction? I have worked with Powershell but not with Access all that much.

Passing a string variable from Batch to VBS

$
0
0

Hello! I'm trying to pass a variable in my batch file to my VBS file. Basically, when you run the batch file it asks for a workstation name. In the sub_LOGOFF section, I'm logging off a user with a VBS script, but I want it to pull the workstation name from the batch file. Is this possible?

Batch File:

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::								    ::
::	WRITTEN BY A1C TYLER STRACHAN - RAF LAKENHEATH 48CS/SCOSC   ::
::      EDITED BY A1C Page - Altus 97CS   ::
::								    ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@ECHO OFF
set __COMPAT_LAYER=RunAsInvoker
color 1E
set remote="\\lke-appsall\CST\Software\REPO"
IF NOT EXIST C:\USERS\PUBLIC\PSEXEC.EXE XCOPY %REMOTE%\TOOLS\PSEXEC.EXE C:\USERS\PUBLIC\ /CKYQ & ATTRIB +H C:\USERS\PUBLIC\PSEXEC.EXE
IF NOT EXIST C:\USERS\PUBLIC\LAUNCHER.BAT XCOPY %REMOTE%\TOOLS\LAUNCHER.BAT C:\USERS\PUBLIC\ /CKYQ & ATTRIB +H C:\USERS\PUBLIC\LAUNCHER.BAT
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::								    ::
::      		MAIN MODULES CONTAINED HERE                 ::
::								    ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:main_START
CLS
TITLE 97CS TOOLBOX
ECHO 97CS TOOLBOX
SET /P workstation=Enter Computer Name or IP Address:
TITLE %WORKSTATION% - 48CS/SCOSC SYSTEM MANAGER
GOTO :main_MAIN



:main_MAIN
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO --------------------------------------------------------------------------------
ECHO.
ECHO MAIN MENU - PLEASE SELECT A CATEGORY:
ECHO --------------------------------------------------------------------------------
ECHO 	1) Networking 			2) Software
ECHO 	3) System Management		4) Change Computers
ECHO 	5) Exit
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12345 /N /M "SELECT A MENU:"
IF ERRORLEVEL 5 GOTO :main_EXIT
IF ERRORLEVEL 4 GOTO :main_START
IF ERRORLEVEL 3 GOTO :main_SYSMAN
IF ERRORLEVEL 2 GOTO :main_SOFTWARE
IF ERRORLEVEL 1 GOTO :main_NETWORKING



:main_NETWORKING
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO --------------------------------------------------------------------------------
ECHO.
ECHO NETWORKING TOOLS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) Ping	 			2) Trace
ECHO 	3) NSLookup			4) Get MAC Address
ECHO 	5) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12345 /N /M "SELECT A MENU:"
IF ERRORLEVEL 5 GOTO :main_MAIN
IF ERRORLEVEL 4 GOTO :sub_GETMAC
IF ERRORLEVEL 3 GOTO :sub_NSLOOKUP
IF ERRORLEVEL 2 GOTO :sub_TRACE
IF ERRORLEVEL 1 GOTO :sub_PING



:main_SOFTWARE
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO --------------------------------------------------------------------------------
ECHO.
ECHO SOFTWARE TOOLS:
ECHO --------------------------------------------------------------------------------
ECHO	1) AtHoc			2) Chrome
ECHO 	3) Firefox			4) Flash
ECHO 	5) Java 8			6) Office 13
ECHO 	7) Shockwave			8) Silverlight
ECHO 	9) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 123456789AB /N /M "SELECT A MENU:"
IF ERRORLEVEL 9 GOTO :main_MAIN
IF ERRORLEVEL 8 GOTO :sub_SILVERLIGHT
IF ERRORLEVEL 7 GOTO :sub_SHOCKWAVE
IF ERRORLEVEL 6 GOTO :sub_OFFICE13
IF ERRORLEVEL 5 GOTO :sub_JAVA8
IF ERRORLEVEL 4 GOTO :sub_FLASH
IF ERRORLEVEL 3 GOTO :sub_FIREFOX
IF ERRORLEVEL 2 GOTO :sub_CHROME
IF ERRORLEVEL 1 GOTO :sub_ATHOC



:main_SYSMAN
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO --------------------------------------------------------------------------------
ECHO.
ECHO SYSTEM MANAGEMENT TOOLS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) HBSS Framework		2) HBSS Update (Force)
ECHO 	3) SCCM				4) Reboot Cancellation
ECHO 	5) Restart System		6) Update Group Policy
ECHO		7) Main			8) LogOff User
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12345678 /N /M "SELECT A MENU:"
IF ERRORLEVEL 8 GOTO :sub_LOGOFF
IF ERRORLEVEL 7 GOTO :main_MAIN
IF ERRORLEVEL 6 GOTO :sub_GROUPPOLICY
IF ERRORLEVEL 5 GOTO :sub_RESTART
IF ERRORLEVEL 4 GOTO :sub_XRESTART
IF ERRORLEVEL 3 GOTO :sub_SCCM
IF ERRORLEVEL 2 GOTO :sub_forceHBSS
IF ERRORLEVEL 1 GOTO :sub_HBSS


:main_EXIT
goto :EOF



::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::								    ::
::	             SUB-ROUTINES CONTAINED HERE		    ::
::								    ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::								    ::
::			     NETWORKING				    ::
::								    ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:sub_PING
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - PING TEST
ECHO --------------------------------------------------------------------------------
PING %WORKSTATION%
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) Networking 			2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_NETWORKING



:sub_TRACE
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - TRACE ROUTE
ECHO --------------------------------------------------------------------------------
TRACERT %WORKSTATION%
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) Networking 			2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_NETWORKING



:sub_NSLOOKUP
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - NAME SERVICE LOOKUP
ECHO --------------------------------------------------------------------------------
NSLOOKUP %WORKSTATION%
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) Networking 			2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_NETWORKING



:sub_GETMAC
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - GETMAC
ECHO --------------------------------------------------------------------------------
GETMAC /S %WORKSTATION%
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) Networking 			2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_NETWORKING



::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::								    ::
::			     SOFTWARE				    ::
::								    ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:sub_ATHOC
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - ATHOC INSTALL
ECHO --------------------------------------------------------------------------------
ECHO YOU ARE ABOUT TO INSTALL ATHOC ONTO %WORKSTATION%
ECHO.
CHOICE /C YN /N /M "PROCEED? Y/N "
IF ERRORLEVEL 2 GOTO :main_SOFTWARE
CLS
SET FILE=\ATHOC\installATHOC.BAT
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - ATHOC INSTALL
ECHO --------------------------------------------------------------------------------
ECHO PLEASE WAIT...
ECHO.
CALL C:\USERS\PUBLIC\LAUNCHER.BAT
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO FINISHED - ATHOC INSTALL
ECHO --------------------------------------------------------------------------------
ECHO INSTALLATION COMPLETE
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) Software 			2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_SOFTWARE



:sub_CHROME
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - CHROME INSTALL
ECHO --------------------------------------------------------------------------------
ECHO YOU ARE ABOUT TO INSTALL GOOGLE CHROME ONTO %WORKSTATION%
ECHO.
CHOICE /C YN /N /M "PROCEED? Y/N "
IF ERRORLEVEL 2 GOTO :main_SOFTWARE
CLS
SET FILE=\CHROME\installCHROME.BAT
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - CHROME INSTALL
ECHO --------------------------------------------------------------------------------
ECHO PLEASE WAIT...
ECHO.
CALL C:\USERS\PUBLIC\LAUNCHER.BAT
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO FINISHED - GOOGLE CHROME INSTALL
ECHO --------------------------------------------------------------------------------
ECHO INSTALLATION COMPLETE
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) Software 			2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_SOFTWARE



:sub_FIREFOX
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - FIREFOX INSTALL
ECHO --------------------------------------------------------------------------------
ECHO YOU ARE ABOUT TO INSTALL MOZILLA FIREFOX ONTO %WORKSTATION%
ECHO.
CHOICE /C YN /N /M "PROCEED? Y/N "
IF ERRORLEVEL 2 GOTO :main_SOFTWARE
CLS
SET FILE=\FIREFOX\installFIREFOX.BAT
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - FIREFOX INSTALL
ECHO --------------------------------------------------------------------------------
ECHO PLEASE WAIT...
ECHO.
CALL C:\USERS\PUBLIC\LAUNCHER.BAT
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO FINISHED - MOZILLA FIREFOX INSTALL
ECHO --------------------------------------------------------------------------------
ECHO INSTALLATION COMPLETE
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) Software 			2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_SOFTWARE



:sub_FLASH
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - FLASH INSTALL
ECHO --------------------------------------------------------------------------------
ECHO YOU ARE ABOUT TO INSTALL ADOBE FLASH ONTO %WORKSTATION%
ECHO.
CHOICE /C YN /N /M "PROCEED? Y/N "
IF ERRORLEVEL 2 GOTO :main_SOFTWARE
CLS
SET FILE=\FLASH\installFLASH.BAT
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - FLASH INSTALL
ECHO --------------------------------------------------------------------------------
ECHO PLEASE WAIT...
ECHO.
CALL C:\USERS\PUBLIC\LAUNCHER.BAT
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO FINISHED - FLASH INSTALL
ECHO --------------------------------------------------------------------------------
ECHO INSTALLATION COMPLETE
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) Software 			2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_SOFTWARE



:sub_JAVA8
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - JAVA 8 INSTALL
ECHO --------------------------------------------------------------------------------
ECHO YOU ARE ABOUT TO INSTALL JAVA 8 ONTO %WORKSTATION%
ECHO.
CHOICE /C YN /N /M "PROCEED? Y/N "
IF ERRORLEVEL 2 GOTO :main_SOFTWARE
CLS
SET FILE=\JAVA8\installJAVA8.BAT
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - JAVA 8 INSTALL
ECHO --------------------------------------------------------------------------------
ECHO PLEASE WAIT...
ECHO.
CALL C:\USERS\PUBLIC\LAUNCHER.BAT
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO FINISHED - JAVA 8 INSTALL
ECHO --------------------------------------------------------------------------------
ECHO INSTALLATION COMPLETE
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) Software 			2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_SOFTWARE



:sub_OFFICE13
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - OFFICE 13 INSTALL
ECHO --------------------------------------------------------------------------------
ECHO YOU ARE ABOUT TO INSTALL OFFICE 13 ONTO %WORKSTATION%
ECHO.
CHOICE /C YN /N /M "PROCEED? Y/N "
IF ERRORLEVEL 2 GOTO :main_SOFTWARE
CLS
SET FILE=\OFFICE13\installOFFICE13.BAT
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - OFFICE 13 INSTALL
ECHO --------------------------------------------------------------------------------
ECHO PLEASE WAIT...
ECHO.
CALL C:\USERS\PUBLIC\LAUNCHER.BAT
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO FINISHED - OFFICE 13 INSTALL
ECHO --------------------------------------------------------------------------------
ECHO INSTALLATION COMPLETE
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) Software 			2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_SOFTWARE



:sub_SHOCKWAVE
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - SHOCKWAVE INSTALL
ECHO --------------------------------------------------------------------------------
ECHO YOU ARE ABOUT TO INSTALL SHOCKWAVE ONTO %WORKSTATION%
ECHO.
CHOICE /C YN /N /M "PROCEED? Y/N "
IF ERRORLEVEL 2 GOTO :main_SOFTWARE
CLS
SET FILE=\SHOCKWAVE\installSHOCKWAVE.BAT
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - SHOCKWAVE INSTALL
ECHO --------------------------------------------------------------------------------
ECHO PLEASE WAIT...
ECHO.
CALL C:\USERS\PUBLIC\LAUNCHER.BAT
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO FINISHED - SHOCKWAVE INSTALL
ECHO --------------------------------------------------------------------------------
ECHO INSTALLATION COMPLETE
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) Software 			2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_SOFTWARE


:sub_SILVERLIGHT
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - SILVERLIGHT INSTALL
ECHO --------------------------------------------------------------------------------
ECHO YOU ARE ABOUT TO INSTALL MICROSOFT SILVERLIGHT ONTO %WORKSTATION%
ECHO.
CHOICE /C YN /N /M "PROCEED? Y/N "
IF ERRORLEVEL 2 GOTO :main_SOFTWARE
CLS
SET FILE=\SILVERLIGHT\installSILVERLIGHT.BAT
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - SILVERLIGHT INSTALL
ECHO --------------------------------------------------------------------------------
ECHO PLEASE WAIT...
ECHO.
CALL C:\USERS\PUBLIC\LAUNCHER.BAT
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO FINISHED - SILVERLIGHT INSTALL
ECHO --------------------------------------------------------------------------------
ECHO INSTALLATION COMPLETE
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) Software 			2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_SOFTWARE



::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::								    ::
::			  SYSTEM MANAGEMENT			    ::
::								    ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:sub_HBSS
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - HOST BASED SYSTEM SECURITY FRAMEWORK INSTALL
ECHO --------------------------------------------------------------------------------
ECHO YOU ARE ABOUT TO INSTALL HBSS ONTO %WORKSTATION%
ECHO.
CHOICE /C YN /N /M "PROCEED? Y/N "
IF ERRORLEVEL 2 GOTO :main_SYSMAN
CLS
SET FILE=\HBSS\installHBSS.BAT
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - HOST BASED SYSTEM SECURITY FRAMEWORK INSTALL
ECHO --------------------------------------------------------------------------------
ECHO PLEASE WAIT...
ECHO.
CALL C:\USERS\PUBLIC\LAUNCHER.BAT
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO FINISHED - HOST BASED SYSTEM SECURITY FRAMEWORK INSTALL
ECHO --------------------------------------------------------------------------------
ECHO INSTALLATION COMPLETE
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) System Management		2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_SYSMAN



:sub_forceHBSS
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - HOST BASED SYSTEM SECURITY FRAMEWORK UPDATE
ECHO --------------------------------------------------------------------------------
ECHO YOU ARE ABOUT TO UPDATE HBSS ONTO %WORKSTATION%
ECHO.
CHOICE /C YN /N /M "PROCEED? Y/N "
IF ERRORLEVEL 2 GOTO :main_SYSMAN
CLS
SET FILE=\HBSS\forceHBSS.BAT
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - HOST BASED SYSTEM SECURITY FRAMEWORK UPDATE
ECHO --------------------------------------------------------------------------------
ECHO PLEASE WAIT...
ECHO.
CALL C:\USERS\PUBLIC\LAUNCHER.BAT
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO FINISHED - HOST BASED SYSTEM SECURITY FRAMEWORK UPDATE
ECHO --------------------------------------------------------------------------------
ECHO UPDATE INITIATED
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) System Management		2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_SYSMAN



:sub_SCCM
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - SYSTEM CENTER CONFIGURATION MANAGER INSTALL
ECHO --------------------------------------------------------------------------------
ECHO YOU ARE ABOUT TO INSTALL SCCM ONTO %WORKSTATION%
ECHO.
CHOICE /C YN /N /M "PROCEED? Y/N "
IF ERRORLEVEL 2 GOTO :main_SYSMAN
CLS
SET FILE=\SCCM\installSCCM.BAT
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - SYSTEM CENTER CONFIGURATION MANAGER INSTALL
ECHO --------------------------------------------------------------------------------
ECHO PLEASE WAIT...
ECHO.
CALL C:\USERS\PUBLIC\LAUNCHER.BAT
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO FINISHED - SYSTEM CENTER CONFIGURATION MANAGER INSTALL
ECHO --------------------------------------------------------------------------------
ECHO INSTALLATION COMPLETE
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) System Management		2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_SYSMAN



:sub_XRESTART
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - SYSTEM RESTART CANCELLATION
ECHO --------------------------------------------------------------------------------
ECHO YOU ARE ABOUT TO CANCEL RESTART %WORKSTATION%
ECHO.
CHOICE /C YN /N /M "PROCEED? Y/N "
IF ERRORLEVEL 2 GOTO :main_SYSMAN
CLS
IF /I %WORKSTATION%==52UKMBW3-CS25HG SET WORKSTATION=%COMPUTERNAME%
IF /I %WORKSTATION%==52MSEKW3-410B3V SET WORKSTATION=%COMPUTERNAME%
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - SYSTEM RESTART
ECHO --------------------------------------------------------------------------------
ECHO PLEASE WAIT...
ECHO.
START cmd.exe /c "shutdown /a /m \\%WORKSTATION%"
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO FINISHED - INITIATED REBOOT CANCELLATION ON %WORKSTATION%
ECHO.
ECHO --------------------------------------------------------------------------------
ECHO ROUTINE COMPLETE
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) System Management		2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_SYSMAN



:sub_RESTART
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - SYSTEM RESTART
ECHO --------------------------------------------------------------------------------
ECHO YOU ARE ABOUT TO RESTART %WORKSTATION%
ECHO.
CHOICE /C YN /N /M "PROCEED? Y/N "
IF ERRORLEVEL 2 GOTO :main_SYSMAN
CLS
IF /I %WORKSTATION%==52UKMBW3-CS25HG SET WORKSTATION=%COMPUTERNAME%
IF /I %WORKSTATION%==52MSEKW3-410B3V SET WORKSTATION=%COMPUTERNAME%
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - SYSTEM RESTART
ECHO --------------------------------------------------------------------------------
ECHO PLEASE WAIT...
ECHO.
START cmd.exe /c "shutdown /r /f /m \\%WORKSTATION% /t 300 /c "Please save your work, your computer will be rebooted in five minutes for essential patching. If your work is essential, and cannot reboot contact the CFP at 481-5341." "
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO FINISHED - INITIATED REBOOT ON %WORKSTATION%
ECHO.
ECHO --------------------------------------------------------------------------------
ECHO ROUTINE COMPLETE
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) System Management		2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_SYSMAN

:sub_LOGOFF
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - LOGOFF USER
ECHO --------------------------------------------------------------------------------
ECHO YOU ARE ABOUT TO LOGOFF THE CURRENT USER OF %WORKSTATION%
ECHO.
CHOICE /C YN /N /M "PROCEED? Y/N "
IF ERRORLEVEL 2 GOTO :main_SYSMAN
CLS
IF /I %WORKSTATION%==52UKMBW3-CS25HG SET WORKSTATION=%COMPUTERNAME%
IF /I %WORKSTATION%==52MSEKW3-410B3V SET WORKSTATION=%COMPUTERNAME%
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - USER LOGOFF
ECHO --------------------------------------------------------------------------------
ECHO PLEASE WAIT...
ECHO.
START cmd.exe /c "start C:\Users\xxxx\Desktop\LogOff.vbs"
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO FINISHED - LOGGED OFF CURRENT USER...
ECHO.
ECHO --------------------------------------------------------------------------------
ECHO ROUTINE COMPLETE
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) System Management		2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_SYSMAN



:sub_GROUPPOLICY
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - GROUP POLICY UPDATE
ECHO --------------------------------------------------------------------------------
ECHO YOU ARE ABOUT TO UPDATE GROUP POLICY ON %WORKSTATION%
ECHO.
CHOICE /C YN /N /M "PROCEED? Y/N "
IF ERRORLEVEL 2 GOTO :main_SYSMAN
CLS
SET FILE=\Tools\GROUPPOLICY.BAT
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO EXECUTING - GROUP POLICY UPDATE
ECHO --------------------------------------------------------------------------------
ECHO PLEASE WAIT...
ECHO.
CALL C:\USERS\PUBLIC\LAUNCHER.BAT
CLS
ECHO CURRENTLY MANAGING - %WORKSTATION%
ECHO.
ECHO FINISHED - UPDATED GROUP POLICY ON %WORKSTATION%
ECHO.
ECHO --------------------------------------------------------------------------------
ECHO ROUTINE COMPLETE
ECHO.
ECHO  RETURN OPTIONS:
ECHO --------------------------------------------------------------------------------
ECHO 	1) System Management		2) Main
ECHO.
ECHO --------------------------------------------------------------------------------
CHOICE /c 12 /N /M "SELECT A MENU:"
IF ERRORLEVEL 2 GOTO :main_MAIN
IF ERRORLEVEL 1 GOTO :main_SYSMAN

VBS File:

' Check command line parameters
Select Case WScript.Arguments.Count
    Case 0
    	' Default is local computer if none specified
    	strComputer = "%WORKSTATION2%"
    Case 1
    	Select Case WScript.Arguments(0)
    		' "?", "-?" or "/?" invoke online help
    		Case "?"
    			Syntax
    		Case "-?"
    			Syntax
    		Case "/?"
    			Syntax
    		Case Else
    			strComputer = WScript.Arguments(0)
    	End Select
    Case Else
    	' More than 1 argument is not allowed
    	Syntax
End Select

' Define some constants that can be used in this script;
' logoff = 0 (no forced close of applications) or 5 (forced);
' 5 works OK in Windows 2000, but may result in power off in XP
Const EWX_LOGOFF   = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT   = 2
Const EWX_FORCE    = 4
Const EWX_POWEROFF = 8

' Connect to computer
Set OpSysSet = GetObject("winmgmts:{(Shutdown)}//" & strComputer & "/root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")

' Actual logoff
for each OpSys in OpSysSet
    OpSys.Win32Shutdown EWX_LOGOFF
next

' Done
WScript.Quit(0)


Sub Syntax
msg = vbCrLf & "Logoff.vbs,  Version 1.00" & vbCrLf & _"Logoff the current user of any WMI enabled computer on the network." & _
      vbCrLf & vbCrLf & "Usage:  CSCRIPT  LOGOFF.VBS  [ computer_name ]" & _
      vbCrLf & vbCrLf & _"Where:  " & Chr(34) & "computer_name" & Chr(34) & _"  is the name of the computer to be logged off" & vbCrLf & _"                         (without leading backslashes); default is " & _
      Chr(34) & "." & Chr(34) & vbCrLf & _"                         (the local computer)." & vbCrLf & vbCrLf & _"Written by Rob van der Woude" & vbCrLf & _"http://www.robvanderwoude.com" & vbCrLf & vbCrLf & _"Based on posts by Alex Angelopoulos on www.developersdex.com" & _
      vbCrLf & _"and Michael Harris on microsoft.public.scripting.vbscript" & vbCrLf
Wscript.Echo(msg)
Wscript.Quit(1)
End Sub

Get-EventLog for Crimson Channel

$
0
0

Hello,

I've been trying to get Crimson Channel logs from 12 different Exchange 2013 servers.  Get-EventLog appears to work so much faster than Get-WinEvent but I'm not able to find if Get-EventLog is able to parse through the Crimson Channel.

Is this even possible, or is this a limitation on Get-EventLog?

Thanks in advance for any help.

Viewing all 15028 articles
Browse latest View live


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