Friday, July 28, 2017

How to inventory all Repliweb Jobs

Recently got an opportunity to explore Attunity's Repliweb, a content deployment tool which can deploy packages across multiple targets from a source code repository. Although the GUI tool provides options to manage the deployment and their resulting logs, it lacks options to export the inventory of all jobs.

But it exposes API via PowerShell to take the inventory. As I was not able to find such script anywhere, thought of sharing it via this post.

Below script creates a csv file in the current directory which will contain all jobs along with their status and edges list.

<#
.SYNOPSIS
Fetches all jobs from Repliweb center
.DESCRIPTION
Fetches all jobs from Repliweb center
.PARAMETER username
A repliweb username
.PARAMETER password
A repliweb password for the username provided
.PARAMETER domain
Domain name for the username
.EXAMPLE
.\fetchJobs.ps1 -username "JohnDoe" -password "secretword" -domain "contoso"
.NOTES
Run this script in a repliweb center's powershell console as administrator.
#>


[CmdletBinding()]
Param(
[parameter(mandatory=$true)]
[string] $username,

[parameter(mandatory=$true)]
[string] $password,

[parameter(mandatory=$true)]
[string] $domain
    )

if ((Get-PSSnapin -Name r1_ps_api -ErrorAction SilentlyContinue) -eq $null )
  {  
      Add-PsSnapin r1_ps_api
  }
##-----------------------------------------------------------------------

## Global Constants
$fileName="$($env:Computername)_$(get-date -format `"yyyyMMdd_hhmmsstt`").txt"
$currentDir=Split-Path $script:MyInvocation.MyCommand.Path
$logfile =  join-path $currentDir $fileName

##-----------------------------------------------------------------------
##-----------------------------------------------------------------------
## Global functions:
function write-log([string[]]$logline)
{
  $logline | out-file -Filepath $logfile -append
}
##-----------------------------------------------------------------------

$R1Session=Get-R1Session
$pass=$R1Session.ScramblePassword($password)
$R1Session.Center="localhost"
$R1Session.User=$username
$R1Session.ScrambledPassword=$pass
$R1Session.Domain=$domain
#$R1Session.QueryFilter.JobType= "R1_DISTRIBUTION"
$connected=$R1Session.Connect()
$jobs=$R1Session.GetJobList()
write-host " Session established and jobs retrieved"
$header="ID,Name,Type,State,SourceDirectory,Stage,Edges"
write-log $header
foreach($job in $jobs)
{
$edges=''
    #job.info = DistributionInfo or MSIInfo
foreach($edge in $job.info.edgesNames)
{
$edges+= $edge + ";"
}  
 $logline=$job.Id + "," + $job.Name + "," + $job.Type + "," + $job.State + "," + $job.SourceDirectory + "," + $job.Stage + "," + $edges
write-log $logline
}
write-host " Export process completed."

Wednesday, May 31, 2017

My journey towards AWS certification

I've cleared the AWS solutions architect - Associate certification last week and would like to share the reference materials which I used for the preparation. Entire exam was focused towards Elastic compute cloud, VPC, IAM and auto scaling. For any one who is trying to get the certification following reading materials will help. As a pre-requisite register for free trial in AWS which will give you 750 hours of EC2, 5 GB in S3 and 750 hours of RDS


Ryan Kroonenberg's Udemy course

Good to get your feet in AWS environment. The purpose of this course is just to get ready for certification but not to get in to the depths of AWS concepts. Every video provides a hands on exercise which will make you understand the concepts by working through it.
Tip : This course is always on a sale and available for $10, if it is not then try in a different browser or browse in incognito mode.

AWS Certified Solutions Architect Official Study Guide

This is the official study guide penned by technical bigwigs at Amazon. It provides in-depth knowledge on each areas of AWS. Every chapter provides a sample quiz and exercise to practice the hands on. If you've done the Udemy course above then most of the exercise is already covered, you can complete the rest of the exercise with your reading on this book.

The only drawback is, this book is bit obsolete, atleast of two re-invent events. So there are new features which will be missing in this book like Enhanced networking, revamped S3 UI, NAT gateway, licensing, few capacity related concepts etc

Wiley test bank

This study guide offers 300+ quiz questions for you to practice. The drawback of the book follows here, some of the question and answer are obsolete. you have to double check with the product FAQ page for the latest changes.

Qwiklabs

This is a paid version of doing hands on exercise, but if you've a free trial in AWS then you can read the instruction provide in here and execute most of the steps in your AWS account. If you are willing to pay, they'll offer points and they create dynamic AWS account every time you invoke a new lab.

Whitepapers and FAQs

Go through the recommended whitepapers(8 whitepapers) and FAQ's (6 faqs) to understand the most recent updates.

Cloudacademy

Cloudacademy has around 300+ quizzes to practice around. They offer time bound quizzes where you will be forced to answer the questions in pre-determined time based on the complexity of the question. Good thing is they offer seven day trial period. So I picked this as the last step in my preparation just to benchmark my reading. They'll charge your credit card $30 per month, if you forget to cancel the trial subscription after seven days.

Sunday, May 28, 2017

Mindmaps from my AWS cert preparation


Following are some mind maps which I prepared as part of reading for AWS certification.

Databases



Elastic compute cloud - EC2



Identity and Access management


Simple Storage Service - S3


Storage Gateway


Amazon's Key services

Managed Services



Friday, July 22, 2016

FireFox and Certificate authentication

When I visit a SharePoint site which is secured with PKI certificate authentication, I usually get certificate selection prompts properly in Internet Explorer and Chrome. Both IE and Chrome are smart enough to show me list of certificates available in my Personal Certificates store.

But when I browse the same PKI secured site in Firefox, I didn't get the certificate selection page and thought of poking around that issue for a solution today. The solution is Firefox is not looking in your personal certificates store. So even though you've imported your certificates to Personal certificates, you should also import them to Firefox certificate store too.

First export you soft key to a folder from your personal certificates.

Open FireFox, navigate to Tools->Options->Advanced->Certificates->View Certificates

After this setting, you'll be shown a certificate selection dialog box every time you browse a site authenticated with a certificate.

Tuesday, July 19, 2016

Hide a SharePoint ECB menu

 There was a requirement to hide a  menu item in  a  document library. The specific menu item is "Compliance Details".

After poking around JavaScript for sometime and the CSS fix looks elegant because of the CSS selectors.

Add a script editor web part and add the below

<style>
li.ms-core-menu-item[text="Compliance Details"]
 {display: none !important;}
</style>

This is actually find all "li" with class "ms-core-menu-item" where the attribute "text" value is "Compliance details" then assign the new style.

CSS selectors allow us to match any menu item by matching them with a display text of the menu.

Wednesday, June 29, 2016

Site Collections Size report

Wanted to quick script to get all site collections size along with their last modified dates, visits. PowerShell is cool enough to do that in two lines.

Get-SPSite -limit All | select url, @{label="Size in MB";Expression={"{0:N2}" -f ($_.Usage.Storage/1000000)}},@{label="ContentDB";Expression={$_.ContentDatabase.Name}},@{label="Visits";Expression={$_.usage.Visits}},@{label="lastmodified";Expression={$_.RootWeb.LastItemModifiedDate}}  | epcsv SiteReport.csv -NoTypeInformation

Thursday, June 23, 2016

Reviving datasheet view in SharePoint 2013 for selective sites


 In SharePoint 2013 the datasheet view is deprecated by Microsoft and Quick edit was promoted. Datasheet view is an ActiveX component which has tight dependency with Internet Explorer and Quick Edit is based on HTML 5, CSS and JS achieving cross platform and cross browser compatibility.
                Datasheet view in legacy platform is ideal for doing bulk row edits and inserts without facing performance issues with few caveats.

How Data Sheet view works?

Datasheet view is an ActiveX component called ListNet from STSList.Dll which accept the below parameters to work properly
  • ListName
  • ViewGuid
  • RootFolder
  • ListWeb
  • ListData
  • ViewSchema
  • ListSchema

Pros and Cons

 Pros

  •  Users will get the legacy control to work in the same fashion without the need of exporting to excel.

Cons

  • Document Center is not supported.
  • Managed metadata is not supported.
  • Cross browser and Cross platform incompatible.