janhoedt
asked on
Powershell: find specific link (servername) in Sharepoint page and show it?
Hi,
I have this sharepoint link:
http://ourserver.ourdomain.com/Asset%20database/Servers.aspx on which there is an entry for each server.
F.e.
Hostname Function
Server01 Exchange server
Server02 Database
Etc
Each hostname is a link which gives full details when you click on it.
Now I would like to be able to look for Server01 via Powershell and show the output in a webbrowser.
Tried via
$webclient = New-Object system.net.webclient
$content = $webclient.DownloadString( "http://ourserver.ourdomain.com/Asset%20database/Servers.aspx")
Idea was then to find the link in the $content then make Powershell look for link and show it, but get an access denied on the downloadstring.
Please advise howto achieve this.
J.
I have this sharepoint link:
http://ourserver.ourdomain.com/Asset%20database/Servers.aspx on which there is an entry for each server.
F.e.
Hostname Function
Server01 Exchange server
Server02 Database
Etc
Each hostname is a link which gives full details when you click on it.
Now I would like to be able to look for Server01 via Powershell and show the output in a webbrowser.
Tried via
$webclient = New-Object system.net.webclient
$content = $webclient.DownloadString(
Idea was then to find the link in the $content then make Powershell look for link and show it, but get an access denied on the downloadstring.
Please advise howto achieve this.
J.
ASKER
Ok, now I get this but nothing much I can do with it either:
StatusCode : 200
StatusDescription : OK
Content :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:o="urn:schemas-micro soft-com:o ffice:offi ce" lang="en-us" dir="ltr">
<head...
RawContent : HTTP/1.1 200 OK
SPRequestGuid: d7af50d3-2f90-4156-aa2a-47 ad72678eec
X-SharePointHealthScore: 1
Persistent-Auth: false
MicrosoftSharePointTeamSer vices: 14.0.0.7006
X-MS-InvokeApp: 1; RequireReadOn...
Forms : {aspnetForm}
Headers :
Images :
InputFields:
Links:
ParsedHtml:
RawContentLength:
StatusCode : 200
StatusDescription : OK
Content :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:o="urn:schemas-micro
<head...
RawContent : HTTP/1.1 200 OK
SPRequestGuid: d7af50d3-2f90-4156-aa2a-47
X-SharePointHealthScore: 1
Persistent-Auth: false
MicrosoftSharePointTeamSer
X-MS-InvokeApp: 1; RequireReadOn...
Forms : {aspnetForm}
Headers :
Images :
InputFields:
Links:
ParsedHtml:
RawContentLength:
ASKER
Also $html.parsedhtml.body.inne rHTML doesn't reveal the servername(s)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
you will just have to filter $html.parsedhtml.body.inne
what I have done is to define variable of what info that I need and build a html report and then sends out notification email.