Monthly Archives: August 2014

How to delete B2D files | BackupExecFAQ

How to delete B2D files | BackupExecFAQ.

Advertisements

Manage windows shortcuts (*.lnk, *.url) using Powershell (Wscript.shell)

Here is a little function that gets you object representation of a Windows shorcut given a path to the shortcut. Files can be piped to it from Get-childItem


function Get-SrvShortcut {
[CmdletBinding()]
Param
(

[parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, ValueFromPipeline=$true, Position=0,
HelpMessage=”Enter path to the shortcut”)]
[string] $FullName
)

begin
{
$WshShell = New-Object -ComObject WScript.Shell;
}

process
{
$WshShell.CreateShortcut($FullName)
}
}

The function can be then used in a script like this (this example modifies shortcuts that live in a certain folder (and subfolders) on many servers. It’s a real life scenario.

Get-ADComputer -filter {name -like "server*"} |
foreach {

$ServerName = $_.Name
$ServerName

$DestPath = "\\$($_.Name)\d`$\NetApplications\_shortcuts"

Get-ChildItem $DestPath -Recurse -Filter *.lnk| Get-SrvShortcut | where {$_.TargetPath -match "AppData" -or $_.WorkingDirectory -match "AppData"} |
foreach {
$NewTargetPath = $_.TargetPath -replace "AppData","NetApp"
$_.TargetPath
$NewTargetPath

$NewWorkingDirectory = $_.WorkingDirectory -replace "AppData","NetApp"
$_.WorkingDirectory
$NewWorkingDirectory

$_.TargetPath = $NewTargetPath
$_.WorkingDirectory = $NewWorkingDirectory
$_.Save()

}

}

Windows PowerShell Shortcut Keys

These are the ones that I use the most

Ctrl+End Press Ctrl+End to delete all the characters in the line after the cursor.

F7 Displays a pop-up window with your command history and allows you to select a command. Use the arrow keys to scroll through the list. Press Enter to select a command to run, or press the Right arrow key to place the text on the command line.

F9 Runs a specific numbered command from your command history. Command numbers are listed when you press F7.

These may be useful

Ctrl+S Press Ctrl+S to pause or resume the display of output

F5 Scans backward through your command history.

Continue reading

Activate Office 2010 using command line

C:\Program Files\Microsoft Office\Office14>cscript ospp.vbs /act

PowerShell : Configure Network Adapter (Set IP,DNS,Gateway,Mask,…)

PowerShell : Configure Network Adapter (Set IP,DNS,Gateway,Mask,…).

EventID 1015 – MsiInstaller – Failed to connect to server and Sharepoint 2013

This warning was generated in hundrets on our production server however did not apperar to have a negative influence on the server’s function.

Log Name: Application
Source: MsiInstaller
Date: 28.7.2014 0:52:43
Event ID: 1015
Task Category: None
Level: Warning
Keywords: Classic
User: TEST\farmAdminAccount
Computer: S7022AP4201.test
Description:
Failed to connect to server. Error: 0x80070005

This is how you can get rid of that repeated event:

1. Add the farm account to the host’s local administrator group.
2. Restart the SharePoint 2010 Timer service.
3. Remove the farm account from the host’s local administrator group.
4. Run the farm’s product Version Job.
5. Check the host’s Application Log.
http://stevemannspath.blogspot.cz/2013/10/sharepoint-2013-server-farm-products.html

EventID 10016 The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID …. and Sharepoint 2013

An annoying error that used to be generated in thousands on our production server

Log Name: System
Source: Microsoft-Windows-DistributedCOM
Date: 31.7.2014 0:52:05
Event ID: 10016
Task Category: None
Level: Error
Keywords: Classic
User: FS\r7022-040001
Computer: S7022AP4201.fs.mfcr.cz
Description:
The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{61738644-F196-11D0-9953-00C04FD919C1}
and APPID
{61738644-F196-11D0-9953-00C04FD919C1}
to the user TEST\user SID (S-1-5-21-3043588770-2694071417-673251328-9138) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool

was be fixed as follows:
1) Use the CLSIS/AppId from the event to find a registry key using regedit. (Mine was HKEY_CLASSES_ROOT\AppID\{61738644-F196-11D0-9953-00C04FD919C1}.) Note the default value under that key. (Mmine was IIS WAMREG admin Service.)
2) Take ownership of the key and give it to the Administrators group (original owner was TrustedInstaller). Make sure the Administrators group has FullControl permissions on the registry key.
3) Run Component services mmc snap-in (dcomcnfg)
4) Open Computers > My Computer > DCOM Config > IIS WAMREG admin Service
5) Go to Properties, Security, Launch and Activation Permissions, Customize, Edit
6) Add all the accounts that Sharepoint server complained about in the eventlog and grant them Local Launch and Activation Permissions.

smsagent

Tips, tricks and time-savers for the Windows and ConfigMgr administrator

To The Point

Anything about Technology and Business

Brian's Power Windows Blog

Microsoft in the Enterprise. Windows, Hyper-V, Exchange, SQL, and more!

PowerScripting Podcast

Shownotes and links for the PowerScripting Podcast, a podcast to help people learn Windows Powershell

Learn Powershell | Achieve More

What is this Powershell of which you speak?