[RRAS] Koppelen IP adres aan VPN username vanuit Shell

Pagina: 1
Acties:

  • Cai
  • Registratie: December 2001
  • Laatst online: 29-01 14:41
Situatie:
Gebruiker logt in op 2003 server RRAS met username pietextern. In Routing and Remote Access staat bij Remote access clients netjes pietextern vermeld met het toegewezen IP adres.

Is het mogelijk om vanuit de shell deze zelfde informatie te halen? Zoiets als "ping 192.168.1.5" response "username = pietextern"

Waarom:
In verband met het gebruik van een webapplicatie wil ik die twee gegevens kunnen koppelen.

Zelf gedaan
Standaard shell commando's geprobeerd, maar werken niet aangezien (en houden zo) pietextern niet in de DNS wordt geregistreerd.
Zoeken,zoeken,zoeken.....(Got,google,enz) maar niets gevonden

[ Voor 5% gewijzigd door Cai op 02-04-2009 22:29 ]


  • Vorkie
  • Registratie: September 2001
  • Niet online
Al gekeken naar de mogelijkheden van Powershell?

User powershell kan je hier wel wat over vertellen denk ik ;)

  • Cai
  • Registratie: December 2001
  • Laatst online: 29-01 14:41
Wat ik heb gevonden is via .vbs de gegevens oproepen, dit lukt bijna. In de MMC van RRAS zie je bij network access clients de ingelogde gebruikers. Deze gegevens kan ik ophalen. Alleen moet je met rechtermuis->status kijken in het pop-up scherm voor het IP-adres. Dit lukt dus nog niet.

Zie (nog niet nette) code
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
' This script makes a report of all Error events in the Event
' Viewer logs. The script uses the MMC 2.0 application object model and
' the Event Viewer snap-in.

Option Explicit

' Create the MMC Application object.
Dim objMMC
Set objMMC = Wscript.CreateObject("MMC20.Application")

' Load a console file.
' The console file in this case contains the Event Viewer snap-in.
' This console file ships with the operating system.
objMMC.Load("rrasmgmt.msc")
 
' Retrieve the Document object. The Document object provides access
' to the ScopeNamespace and ActiveView objects.
Dim objDoc
Set objDoc = objMMC.Document

' Retrieve the ScopeNamespace object. The ScopeNamespace object
' will be used when navigating the scope tree.
Dim objSN
Set objSN = objDoc.ScopeNamespace

' Get the console root node.
Dim objRoot
Set objRoot = objDoc.RootNode

' Using the console Root Node, get the Event Viewer node.
Dim objEvtVwrNode
Set objEvtVwrNode = objSN.GetChild(objRoot)

' Expand the Event Viewer Node.
objSN.Expand(objEvtVwrNode)

' Get the ActiveView, which is a View object.
' This object is used to access the list of nodes and column data.
Dim objView
Set objView = objDoc.ActiveView

' Get the first child node of the Event Viewer node.
On Error Resume Next
Dim objNode
Set objNode = Nothing
Set objNode = objSN.GetChild(objEvtVwrNode)
if (objNode Is Nothing) then
    ' Unexpected condition.
    Wscript.echo "Unable to get Event Viewer child node."
    Wscript.quit 
end if

Dim objSib  ' Used when moving to the next child (sibling) node.
' Loop through each Event Viewer's child nodes.
Do Until (objNode is Nothing)
    ' Expand the Event Viewer's child node.
    objSN.Expand(objNode)

    ' Display text stating which node is being examined.
    if objnode.Name="SERVERNAME" then   
    Set objNode = objSN.GetChild(objEvtVwrNode)
    if (objNode Is Nothing) then
            ' Unexpected condition.
            Wscript.echo "Unable to get Event Viewer child node."
            Wscript.quit 
    end if


    ' Loop through each Event Viewer's child nodes.
    Do Until (objNode is Nothing)
    Wscript.echo objnode.Name


     Set objSib = Nothing
        Set objSib = objSN.GetNext(objNode)
        Set objNode = objSib

    Loop
 
    end if

    ' Set the active scope node to the child node.
    objView.ActiveScopeNode = objNode

    ' Access the view's list of nodes.
    ' objView.ListItems represents the nodes in the list view.
    Dim objList
    Set objList = objView.ListItems

    ' Iterate through the list of nodes.
    Dim objItem
    For Each objItem In objList
        Dim str
        ' Retrieve the data in the first column. In the Event Viewer
        ' snap-in, the first column is for the Event type.
        str = objView.CellContents(objItem, 1)
        ' Determine if the event type is for an Error event.
  
    If counter=2 Then
            ' The node is for an Error event.
            ' Output the details of this Error event, with 
            ' a comma separating each data field.

            'Wscript.echo objView.CellContents(objItem, 1) + ",", _
                        ' objView.CellContents(objItem, 2) + ",", _
                        ' objView.CellContents(objItem, 3) + ",", _
                        ' objView.CellContents(objItem, 4) 
        End If
    Next

    ' Print a blank line before the next child node is processed.
    'Wscript.echo ""

    ' Move to the next node under the Event Viewer node.
    Set objSib = Nothing
    Set objSib = objSN.GetNext(objNode)
    Set objNode = objSib

Loop


Iemand een idee hoe je de onderliggende properties van een node row uitleest.

  • Cai
  • Registratie: December 2001
  • Laatst online: 29-01 14:41
Gezien de inhoud van dit topic wijzigt richting scripting vragen is het wellicht een idee dat deze verplaatst wordt naar het betreffende forum...?

  • Turdie
  • Registratie: Maart 2006
  • Laatst online: 20-08-2024
Cai schreef op zondag 05 april 2009 @ 21:48:
Gezien de inhoud van dit topic wijzigt richting scripting vragen is het wellicht een idee dat deze verplaatst wordt naar het betreffende forum...?
Hier doen we ook aan scripting hoor.


Volgens mij kunt je het ook doen met een simpel commando namelijk zo:
Verbonden clients:
netsh ras show clients 

Verbonden users:
netsh ras show users

Used without parameters, show user displays the properties of all remote access users.
Dit lijkt me behoorlijk makkelijk te verwerken in een script.


Daarnaast kun je volgens mij wel iets doen met het openfiles commando, maar dan moet de user wel files openstaan in zijn haar sessie naar de server.

[ Voor 16% gewijzigd door Turdie op 05-04-2009 22:21 ]


  • powerboat
  • Registratie: December 2003
  • Laatst online: 19:09
Als je bedoelt dat een VPN gebruiker nadat hij is ingelogd de windows logonname ergens neer moet plaatsen in bijv txt bestand or whatever.

kijk dan eens naar AutoIT script die gebruikt @username (o ja en kun je compilen)

  • Turdie
  • Registratie: Maart 2006
  • Laatst online: 20-08-2024
ljarutten schreef op zondag 05 april 2009 @ 22:10:
Als je bedoelt dat een VPN gebruiker nadat hij is ingelogd de windows logonname ergens neer moet plaatsen in bijv txt bestand or whatever.

kijk dan eens naar AutoIT script die gebruikt @username (o ja en kun je compilen)
Heeft Windows zelf ook namelijk %username%

Doe maar eens
echo %username%
.

Dit is trouwens wel heeel erg basic,by the way

[ Voor 10% gewijzigd door Turdie op 05-04-2009 22:27 ]


  • powerboat
  • Registratie: December 2003
  • Laatst online: 19:09
shadowman12 schreef op zondag 05 april 2009 @ 22:25:
[...]


Heeft Windows zelf ook namelijk %username%

Doe maar eens
echo %username%
.

Dit is trouwens wel heeel erg basic,by the way
Ach ja idd *vergeten* 8)7

  • Cai
  • Registratie: December 2001
  • Laatst online: 29-01 14:41
shadowman12 schreef op zondag 05 april 2009 @ 22:25:
[...]


Heeft Windows zelf ook namelijk %username%

Doe maar eens
echo %username%
.

Dit is trouwens wel heeel erg basic,by the way
Helaas werkt dit niet. Je krijgt nl. de username terug van lokale account (bijv. Pietje thuis). In domein omgevingen (en gecontroleerde) externe computers werkt dit wel. Bij het aanmelden van externe non-ad computers, die zich aanmelden bij RRAS welke de authenticatie verzoeken doorstuurt naar een RADIUS server, werkt het (helaas) niet.
shadowman12 schreef op zondag 05 april 2009 @ 22:00:
[...]

Hier doen we ook aan scripting hoor.


Volgens mij kunt je het ook doen met een simpel commando namelijk zo:
Verbonden clients:
netsh ras show clients 

Verbonden users:
netsh ras show users

Used without parameters, show user displays the properties of all remote access users.
Dit lijkt me behoorlijk makkelijk te verwerken in een script.


Daarnaast kun je volgens mij wel iets doen met het openfiles commando, maar dan moet de user wel files openstaan in zijn haar sessie naar de server.
netsh ras show users

Zonder de "s" werkt het commando, maar krijg ik niet de ingelogde gebruikers te zien actief op de VPN verbinding.

netsh ras show clients 

Werkt! gedeeltelijk. De gebruikersnamen van de ingelogde gebruikers wordt weergegeven, het IP-adres echter niet.

Situatie is dus als volgt:
Piet logt in via vpn (RRAS icm non-windows RADIUS). Piet staat netjes in RRAS geregistreerd met username/IP-adres.

Piet gaat naar http://vpnportal.bedrijf.nl/

Op de portal staat, bijv. Hoi Piet!

[ Voor 52% gewijzigd door Cai op 06-04-2009 17:09 ]


  • Cai
  • Registratie: December 2001
  • Laatst online: 29-01 14:41
[dubbelpost]

[ Voor 95% gewijzigd door Cai op 06-04-2009 16:55 ]


  • Turdie
  • Registratie: Maart 2006
  • Laatst online: 20-08-2024
Wat voor portal gebruiken jullie, Sharepoint toevallig?

  • Cai
  • Registratie: December 2001
  • Laatst online: 29-01 14:41
shadowman12 schreef op maandag 06 april 2009 @ 18:56:
Wat voor portal gebruiken jullie, Sharepoint toevallig?
Nope, Maatwerk ASP webapplicatie.
Pagina: 1