Showing posts with label Script. Show all posts
Showing posts with label Script. Show all posts

Tuesday, May 19, 2015

Download large file from google drive


If there is the large file from google drive and you don't want download from browser, you may try this :

So for example when you share a file on google drive publicly the sharelink looks like this:

https://drive.google.com/file/d/XXXXXXXXXXXXXXX/view?usp=sharing
Then you copy the file id and create a googledrive.com linke that look like this:

https://www.googledrive.com/host/XXXXXXXXXXXXXXX
And paste this link to your download program.


Tuesday, May 5, 2015

Manage File and Printer shares, local or on a remote server

RMTSHARE.exe ( Download )

Manage File and Printer shares, local or on a remote server.
Although missing from recent Resource kits, the old version appears to work fine under Windows XP/2003/win7.

Syntax
  Display all shares
      RMTSHARE \\server

  Display details of a specific share
      RMTSHARE \\server\sharename

  Share a Folder 
      RMTSHARE \\server\sharename=drive:path [options]

  Share a Printer 
      RMTSHARE \\server\sharename=printername /PRINTER [options]

  Edit an existing SHARE
      RMTSHARE \\server\sharename [options]

  Delete a SHARE
      RMTSHARE \\server\sharename /DELETE

Options
      /USERS:number 
      /UNLIMITED
      /REMARK:"text"
      /GRANT user:perm
      /REMOVE user
Notes: Either specify /Users to restrict the number of connections that can be made OR specify /UNLIMITED
You can include several /GRANTs in a single command line.
Enclose paths that include spaces like this
\\server\"long share name"="c:\long file name"
An alternative way to list remote shares with PowerShell:
# List the file shares on the remote server: SERVER.

$shares = Get-WmiObject -class Win32_Share -computername SERVER -filter "Type=0"

$shares | foreach {
$path=($_.path)
$Description=($_.Description)
$name=($_.name)
$Caption=($_.Caption)
 
"Share Name   : $name
Source Folder: $path 
Description  : $Description
Caption : $Caption
"
}

Removing collection from the database that didn’t exist in the console

I notice there is some collection missing in console but exist in database. After do some research, it will become an issue while upgrading from SCCM 2007 to SCCM 2012.

First, run sql below:
Select * from collections
Then identified which collection does not appear in console and delete by sql below:

DELETE FROM collections
WHERE CollectionName='Your Collection'
If you are interested to know more about the issue, Check It Out

Warning: It is not supported to modify the ConfigMgr database in any way. 

Tuesday, April 21, 2015

Silent Key for PowerPoint Viewer 2003

To install PowerPoint Viewer 2003 silently, I used

ppviewer.exe /Q /C:"msiexec.exe /i ppviewer.msi /qb-!"

Saturday, April 18, 2015

Disable password expiration in Windows 7 Home Premium

In Windows 7 Home Premium, that is no way to set password expiration from 'User Accounts' and GUI tool to set it. If you want to set password expiration do the following :

1. Click Start button
2. Type 'wmic' in 'Search programs and files'
3. Right click 'wmic' and 'Run as Administrator'
4. Type following code 'UserAccount where PasswordExpires=TRUE set PasswordExpires=FALSE'
5. Comfirm with 'Y'
6. Done.

Wednesday, April 15, 2015

Desired Configuration Management - Trigger Evaluation Remotely

VBscript as below, copy and save as *.vbs :

 On Error Resume Next
CompName = Wscript.Arguments(0)
If compname = "" Then
  CompName = InputBox("Input a Computer name or IP", "Computer Name",CompName)
End If
err.clear
set DCMInvoke = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
 CompName & "\root\ccm\dcm:SMS_DesiredConfiguration")
 if err.number <> 0 then
 msgbox "unable to access " & CompName & vbcr &_
   "Error: " & err.description,,"SMS DCM Trigger Evaluation"
 else
  Set objSWbemServices = GetObject("winmgmts:\\" & CompName & "\root\ccm\dcm")
  Set colSWbemObjectSet = objSWbemServices.ExecQuery("SELECT * FROM SMS_DesiredConfiguration")
  For Each objSWbemObject In colSWbemObjectSet
   DCMInvoke.TriggerEvaluation objSWbemObject.Name,objSWbemObject.Version
  Next
 end if